* Max Nikulin <maniku...@gmail.com> [2022-10-09 19:41]: > 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.
Thank you. Directly of courseworks, but that would mean that you have to make several clicks, not just one click. It also implies you must have Emacs in front of you, and not sitting around as server in background or anywhere. You must be on window manager workspace with Emacs to capture X selection as without Emacs in front of you, how do you invoke it in that case? > The idea of org-protocol is to pass more data. It is structured data, something like '(:url "https://www.example.com" :title "Something" :body "More here") and it may be anything in general. But no, I don't find it appealing in itself apart from using those ready made browser extensions. In fact when we speak of capturing any selection from X, I would not like relying on Emacs, it would be better using SQLite or PostgreSQL for that. One can define templates and forms and use some graphical dialogs like yad, zenity, which then insert things into database. Once in Emacs, it is easy to convert it without doing anything, to Org or any other type of file. Of course I don't use Org capture browser extensions to insert anything in Org files. Not when I have it faster and better. > 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. That is great simplest note taking system. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/