I’m using Aquamacs, a macOS variant of Emacs. I’m writing an ELisp function that needs to paste the OS clipboard’s content. I tried using both (yank)
and (cua-paste nil)
(I’m not sure about the argument cua-paste
expects, though).
The problem is that when I copy text from another application, the text pasted is not that one, but rather whatever content was last pasted in Aquamacs.
If I first paste the text manually in Aquamacs once, using ⌘V, then ulterior calls to my function do paste that, as desired.
What code can I use to paste the contents of the OS clipboard?