From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: why is this function not instantaneous?
Date: Fri, 22 Mar 2013 14:08:16 +0800 [thread overview]
Message-ID: <87li9g55m7.fsf@ericabrahamsen.net> (raw)
In-Reply-To: kifnj401e9e@news1.newsguy.com
"B. T. Raven" <btraven@nihilo.net> writes:
> Eric wrote:
>
>> (defun my-yank-to-other-window (p m)
>> "Yank region to point of other window."
>> (interactive "r")
>> (let ((s (if (use-region-p)
>> (buffer-substring-no-properties p m)
>> (current-word))))
>> (select-window (next-window))
>> (insert s)))
>
> Thanks, Eric. That works without delay. Since I use this only (almost
> only) to transfer text between a dictionary and an rcirc window, I will
> use this hybrid of my and your functions:
>
> (defun tow (p m) ;; bind to F8
> "Copy region text or word to buffer in other window\n"
> (interactive "r")
> (let ((s (if (use-region-p)
> (buffer-substring-no-properties p m)
> (current-word nil t))))
> (other-window 1)
> (insert s)))
>
> I don't really understand the "strict" and "reallyword" optional
> arguments to 'current-word but using nil and t for them doesn't cause a
> hang-up like my 'copy-region-as-kill function did. (could it be coercing
> garbage collection?) In fact, 'current-word was a new function to me.
> Thanks for that.
It really beats me why yours was slow, but at least it's solved! The
STRICT arg to current-word, if nil, lets you slurp in the nearest word
(even if it's many spaces distant). If REALLYWORD is nil, it adds a few
less "wordy" characters (those matching the "_" syntax) to what it will
consider a word. I agree the docstring is unhelpful, though. Anyway,
neither of those would cause a hangup, so that's still a mystery...
E
prev parent reply other threads:[~2013-03-22 6:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-19 20:04 why is this function not instantaneous? B. T. Raven
2013-03-20 1:30 ` Eric Abrahamsen
[not found] ` <mailman.22508.1363742738.855.help-gnu-emacs@gnu.org>
2013-03-21 19:38 ` B. T. Raven
2013-03-22 6:08 ` Eric Abrahamsen [this message]
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87li9g55m7.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=help-gnu-emacs@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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).