|
From: | Maxim Nikulin |
Subject: | Re: idea for capture anywhere in x |
Date: | Thu, 10 Sep 2020 21:23:01 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |