From: Marc Tfardy <m-t-o___CUT__IT@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: non-continuous selection?
Date: Sun, 01 Mar 2009 15:31:46 +0100 [thread overview]
Message-ID: <49AA9C52.9080800@web.de> (raw)
In-Reply-To: <6fa0ca5f-f67c-430a-bbd7-980a4da05db9@v19g2000yqn.googlegroups.com>
lakerhy schrieb:
> is there any method to get a non-continous selection?
>
> for example, if the text is as following:
>
> 123
> 456
> 789
>
> I want to select 1 5 9 which is not continous or in a rectangle. How
> this could be done?
Do you want select "1", then "5" and then "9" and then paste all
together at one shot "159"? This small and simple function do this:
(defun insert-collected-kill-ring (count)
"Collect COUNT items from kill-ring and insert into buffer."
(interactive "p")
(if (>= (length kill-ring) count)
(progn
(let ((n (- count 1))
(str ""))
(while (>= n 0)
(setq str (concat str (substring-no-properties (nth n
kill-ring))))
(setq n (1- n)))
(insert str)))
(error "No enough items in kill-ring")))
You must select n piece of text, for each one do "copy" (M-w) and then
call insert-collected-kill-ring with numeric argument. For your example:
C-u 3 M-x insert-collected-kill-ring.
Please note that this function inserts oldest first, but this is often
what one expect so you get "159" and not "951".
HTH
regards
Marc
next prev parent reply other threads:[~2009-03-01 14:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-01 11:28 non-continuous selection? lakerhy
2009-03-01 14:31 ` Marc Tfardy [this message]
2009-03-01 17:14 ` lakerhy
2009-03-01 18:03 ` Marc Tfardy
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=49AA9C52.9080800@web.de \
--to=m-t-o___cut__it@web.de \
--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.