09.09.2020 11:52, Maxim Nikulin wrote:

Capture templates allow calling of arbitrary lisp code, so you could take value from kill ring or call low level gui-get-selection function. The latter would allow separate templates for primary selection and for clipboard.

Today I have noticed that there are %c and %x substitutions for capture templates (thanks to the patch suggesting %L). With default preferences emacs listen to X clipboard and adds its contents to kill-ring, so current clipboard content is available as %c. %x at first tries primary selection. So there is no need to call gui-get-selection directly. By default both variants of selection are available through substitutions. If emacs is tuned to use primary selection, there is a compatibility function org-get-x-clipboard.


Reply via email to