On 09/10/2022 21:47, Jean Louis wrote:

I have basic concept to capture X selection in file and get it in
Emacs. It is not really related to Org, one can capture X selection
and record it anyhow. There is no need for org-protocol this way.

File: ~/bin/capture-x-selection.sh

#!/usr/bin/bash
TEMP=/tmp/xselection.txt
xsel -o > $TEMP

Jean, take a breath and think several minutes on your recipe. You will figure out that (perhaps unsafe) intermediate file is redundant. Emacs can access text/plain target of PRIMARY_SELECTION and CLIPBOARD directly (anyway xsel, unlike xclip, is not your friend if you need more). In default configuration C-y yanks from CLIPBOARD, mouse middle click from PRIMARY_SELECTION.

The idea of org-protocol is to pass more data.

Outside of Org there is e.g. remember mode (info "remember")
https://www.gnu.org/software/emacs/manual/html_mono/remember.html
You might notice remnants of org-remember in docs related to org-capture.



Reply via email to