all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "B. T. Raven" <btraven@nihilo.net>
To: help-gnu-emacs@gnu.org
Subject: Re: why is this function not instantaneous?
Date: Thu, 21 Mar 2013 14:38:37 -0500	[thread overview]
Message-ID: <kifnj401e9e@news1.newsguy.com> (raw)
In-Reply-To: <mailman.22508.1363742738.855.help-gnu-emacs@gnu.org>

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.

Btw, my pathological naming 'tow is just so I can used M-x tow in case I
want to assign something else to f8.

Ed



  parent reply	other threads:[~2013-03-21 19:38 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 [this message]
2013-03-22  6:08     ` Eric Abrahamsen

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

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

  git send-email \
    --in-reply-to=kifnj401e9e@news1.newsguy.com \
    --to=btraven@nihilo.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.