Org-mode mailing list
 help / color / mirror / Atom feed
From: Maxim Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: idea for capture anywhere in x
Date: Wed, 9 Sep 2020 11:52:31 +0700
Message-ID: <rj9n2g$11b7$1@ciao.gmane.io> (raw)
In-Reply-To: <CAJcAo8sTTRL_m58urs=c4YT=wXpmuzgEu_O3OeVUPZMgXbd5=Q@mail.gmail.com>

09.09.2020 05:40, Samuel Wales wrote:
> On 9/7/20, Maxim Nikulin <manikulin@gmail.com> wrote:
>> Do you mean a tiny tool that takes content of X primary selection or
>> clipboard and passes it to emacs-client org-protocol argument?
> 
> maybe.  guessing probably.  i want it to take contents of x primary
> selection or clipboard and get it into emacs using a capture template
> item.  whether this requries oprg-protocl, idk.

Isn't Tim's suggestion suitable for you (to call emacsclient --eval 
'(org-capture)' directly without any additional tool or even 
org-protocol)? I noticed his answer after I sent my message.

Some wrapper to create a new frame may be necessary, but since you are 
likely happy with your desktop protocol handler, you could use very 
similar script with eval instead of org-protocol argument when 
emacsclient is invoked.

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.

I do not know what is more convenient for you, to use emacs capture 
template dialog or dedicated menu items or hotkeys in window manager for 
access to primary selection and clipboard and passing additional 
argument to org-capture.

By the way, is there a convention for keystrokes that allows both 
clipboard and primary selection? I have seen that either option could be 
configured for default kill/yank but sometimes it is convenient to use both.

>> The harder part is extracting of formatted text (that could be
>> application specific) and converting it to org markup. I had a look
>> into emacs sources and did not find extension points to obtain
>> application-specific format, so external tool could provide some benefit
>> (e.g. capturing link with description from libreoffice).
> 
> while such features would be great, my needs are modest i think.  i
> would be delighted with just plain text.
> 
> but if possible i'd want it to be inserted as utf-8 even if the
> terminal or deluge or whatever uses some different encoding.

With spread of UTF-8 I almost forget problems with charsets. I hope, 
currently it should be workarounds for particular applications.

I have seen comments that modern pandoc could convert various formats to 
org. As to working with formatted text, previous time my curiosity was 
exhausted after the following commands for tcl

package require Tk
puts "[selection get -type TARGETS]"
puts "[selection get -type text/html -selection CLIPBOARD]

I have not searched which languages provide easy access to selection 
with minimal dependencies and if there are some ready to use libraries 
to extract rich text. Maybe sources of a browser or an office 
application should be expected (or of some simple application that still 
allows to copy-paste of rich text).



  reply	other threads:[~2020-09-09  4:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  4:22 Samuel Wales
2020-09-08  5:01 ` Tim Cross
2020-09-08  5:05   ` Samuel Wales
2020-09-08  5:21     ` Tim Cross
2020-09-08  7:18       ` Maxim Nikulin
2020-09-08  8:03         ` Diego Zamboni
2020-09-08 16:08           ` Maxim Nikulin
2020-09-08  5:39     ` Maxim Nikulin
2020-09-08 22:40       ` Samuel Wales
2020-09-09  4:52         ` Maxim Nikulin [this message]
2020-09-10 14:23           ` Maxim Nikulin
2020-09-12  8:48             ` Nick Econopouly
2020-09-09  8:40     ` Russell Adams
2020-09-09 21:11       ` Samuel Wales
2020-09-09  1:07 ` Ihor Radchenko
     [not found] <mailman.51.1599580808.12104.emacs-orgmode@gnu.org>
2020-09-08 23:15 ` No Wayman
2020-09-13 20:29   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='rj9n2g$11b7$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git