From: Ihor Radchenko <firstname.lastname@example.org>
To: Max Mikhanosha <email@example.com>
Subject: Re: BUG+PATCH org-capture hangs under Cygwin/X
Date: Sun, 31 Jul 2022 20:45:53 +0800 [thread overview]
Message-ID: <87r121labi.fsf@localhost> (raw)
Max Mikhanosha <firstname.lastname@example.org> writes:
> Due to various reasons I'm now using Cygwin/X Emacs, and for this emacs,
> (gui-get-selection) method is kind of slow (about 0.2) seconds.
> Attached patch changes it so that we only call (org-get-x-clipboard) and
> (current-kill 0) lazily. The logic had not changed, we just don't pre-cache
> values that we don't need.
Thanks for your contribution!
The idea looks reasonable.
However, I am unable to apply the patch onto current main branch. Please
> Subject: [PATCH] org-capture: fix hang under Cygwin/X emacs.
> * org-capture.el (org-capture-fill-template): change it so that
> (current-kill 0) and (org-get-x-selection) are called only lazily on
> as needed basis, and their results are cached.
> This reduces worst case of calling (gui-get-selection) from 28 times
> to 12 (worst case being both clipboard and selection being empty)
> and in the best case of there being no %x %c or %^C template
> arguments there will be zero calls
Please follow the formatting conventions for the commit messages as
In particular, pay attention to the space between sentences, ending
sentences with a full stop, and quoting the Elisp `symbols'.
The same applies for comments in code.
> + ;; On Cygwin/X org-get-x-clipboard is extremely slow
> + ;; therefore use lazy evaluation for calling x-org-get-clipboard
For example, `org-get-x-clipboard' should be quoted, and the comment
should end with ".".
> + (x-clip-cache (list (list 'PRIMARY nil nil)
> + (list 'CLIPBOARD nil nil)
> + (list 'SECONDARY nil nil)))
A more compact form is
(x-clip-cache `((PRIMARY nil nil) (CLIPBOARD nil nil) (SECONDARY nil nil))
prev parent reply other threads:[~2022-07-31 12:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 3:44 BUG+PATCH org-capture hangs under Cygwin/X Max Mikhanosha
2022-07-31 12:45 ` Ihor Radchenko [this message]
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:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).