From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marc Tfardy Newsgroups: gmane.emacs.help Subject: Re: non-continuous selection? Date: Sun, 01 Mar 2009 15:31:46 +0100 Message-ID: <49AA9C52.9080800@web.de> References: <6fa0ca5f-f67c-430a-bbd7-980a4da05db9@v19g2000yqn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1235918443 25313 80.91.229.12 (1 Mar 2009 14:40:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Mar 2009 14:40:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 01 15:42:00 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ldmrf-00016B-Kh for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Mar 2009 15:41:59 +0100 Original-Received: from localhost ([127.0.0.1]:44248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdmqK-0006J8-LR for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Mar 2009 09:40:36 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-X-Trace: individual.net Y+NwJxMJfVo0szT3k7upygpsxYb+hpW69ia9zNACiqeTy90VYs Cancel-Lock: sha1:IGaNmZ10fAZS9n4R9qRhR/SoA5M= User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) In-Reply-To: <6fa0ca5f-f67c-430a-bbd7-980a4da05db9@v19g2000yqn.googlegroups.com> Original-Xref: news.stanford.edu gnu.emacs.help:167191 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62491 Archived-At: 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