From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: 2rb1 Newsgroups: gmane.emacs.help Subject: Re: Copy rectangle - strange side effect Date: Thu, 25 Oct 2012 15:24:25 -0700 (PDT) Message-ID: <1351203865925-268100.post@n5.nabble.com> References: <1351180139167-268053.post@n5.nabble.com> <8FE7D72E-983D-4830-904A-3C430FACADFF@Web.DE> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351203875 6784 80.91.229.3 (25 Oct 2012 22:24:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Oct 2012 22:24:35 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 26 00:24:43 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TRVr1-0002Yi-4q for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 00:24:43 +0200 Original-Received: from localhost ([::1]:42436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRVqt-00065g-BU for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Oct 2012 18:24:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRVqo-00065a-04 for Help-gnu-emacs@gnu.org; Thu, 25 Oct 2012 18:24:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRVql-00083N-V8 for Help-gnu-emacs@gnu.org; Thu, 25 Oct 2012 18:24:29 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:54778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRVql-00082z-Q8 for Help-gnu-emacs@gnu.org; Thu, 25 Oct 2012 18:24:27 -0400 Original-Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TRVqj-000546-U4 for Help-gnu-emacs@gnu.org; Thu, 25 Oct 2012 15:24:25 -0700 In-Reply-To: <8FE7D72E-983D-4830-904A-3C430FACADFF@Web.DE> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 216.139.236.26 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87424 Archived-At: Thank you for the reply Peter Dyballa wrote > Not showing us your Elisp code. > > Are you aware of C-x r r, copy-rectangle-to-register? > > -- > Greetings > > Pete > > "Debugging? Klingons do not debug. Our software does not coddle the weak." The code is in the first post; but perhaps the tag does not translate well to mails (new to the forum as well...). Anyway, here it is in plain ASCII: (defun my-copy-rectangle () "Copy rectangle as kill: Make a copy of rectangle as defined by region and put into kill ring" (interactive) (setq my-start (region-beginning)) (setq my-end (region-end)) (kill-rectangle my-start my-end) (goto-char my-start) (yank-rectangle) ) (global-set-key [S-M-insert] 'my-copy-rectangle) ; ++ Copy R (global-set-key [M-delete] 'kill-rectangle) ; + Cut R I was not aware of the copy-rectangle-to-register; but having to also type in a register name when I paste will probably not save me any key strokes. Or do you suggest to use it to bind it to a key with using a the same register for the corresponding yank/paste option? I will try that tomorrow. /2rb1 -- View this message in context: http://emacs.1067599.n5.nabble.com/Copy-rectangle-strange-side-effect-tp268053p268100.html Sent from the Emacs - Help mailing list archive at Nabble.com.