emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possibility to copy text outside EMACS and send it to orgmode docume


From: Maxim Nikulin
Subject: Re: Possibility to copy text outside EMACS and send it to orgmode document
Date: Wed, 6 Jan 2021 23:14:26 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 06/01/2021 13:41, Gerardo Moro wrote:
Basically that: as I copy (Control-C) text from the browser (Chrome), I would like those copied sentences to be sent to a ordered list in an OrgMode document:

- copied text 1
- copied text 2
- etc.

Any ideas? This would be very useful.

To add to emacs a key binding that runs a script calling pandoc, something like (untested, you are asking for ideas), and inserting new text from clipboard

in_file=`mktemp --tmpdir convert.XXXXXX.html`
out_file=`mktemp --tmpdir convert.XXXXXX.org`
xclip -out -target text/html >"$in_file"
pandoc --output="$out_file" "$in_file"
xclip -in <"$out_file"

No need to setup org-protocol. Maybe it is possible to avoid temporary files.

TODO:
- Temporary files should be removed
- Unsure if pandoc is safe in respect to peculiar HTML formatting, maybe it has some special options for conversion of non-trusted files.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]