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: Fri, 26 Oct 2012 04:31:46 -0700 (PDT) Message-ID: <1351251106755-268134.post@n5.nabble.com> References: <1351180139167-268053.post@n5.nabble.com> <8FE7D72E-983D-4830-904A-3C430FACADFF@Web.DE> <1351203865925-268100.post@n5.nabble.com> 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 1351251122 1869 80.91.229.3 (26 Oct 2012 11:32:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 11:32:02 +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 13:32:09 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 1TRi8z-0003lQ-8y for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 13:32:05 +0200 Original-Received: from localhost ([::1]:57375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRi8r-0001sP-D7 for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 07:31:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRi8j-0001sE-NY for Help-gnu-emacs@gnu.org; Fri, 26 Oct 2012 07:31:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRi8i-0003ik-LE for Help-gnu-emacs@gnu.org; Fri, 26 Oct 2012 07:31:49 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:34255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRi8i-0003ic-Fy for Help-gnu-emacs@gnu.org; Fri, 26 Oct 2012 07:31:48 -0400 Original-Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TRi8g-0002rx-Ol for Help-gnu-emacs@gnu.org; Fri, 26 Oct 2012 04:31:46 -0700 In-Reply-To: <1351203865925-268100.post@n5.nabble.com> 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:87443 Archived-At: So I tried the copy-rectangle-to-register approach as follows: (global-set-key [M-insert] (lambda () (interactive) (insert-register t ))) (global-set-key [S-M-insert] (lambda () (interactive) (copy-rectangle-to-register t (region-beginning) (region-end) )) ) Seemed to work. Now, I would like also to be able to have a delete-rectangle-to-register functionality, so I came up with this: (defun my-delete-rectangle-to-register () "Copy rectangle : Make a copy of rectangle as defined by region and put into reg" (interactive) (setq my-start (region-beginning)) (setq my-end (region-end)) (copy-rectangle-to-register t my-start my-end) (delete-rectangle my-start my-end ) ) (global-set-key [M-delete] 'my-delete-rectangle-to-register ) At first (in the Lisp buffer) this seemed to work as expected. This was also true in Tcl mode; but in VHDL mode the last function would only delete a few characters following region-end. Unfortunately, this is where I need these functions the most. So I guess this is somehow related to the VHDL mode. Why this is the case when the functions seems to work flawlessly when invoked manually beats me. But then, I have to admit I am not familiar with the internal details of Emacs - I am just a (mostly) happy user :-) Any ideas? /2rb1 -- View this message in context: http://emacs.1067599.n5.nabble.com/Copy-rectangle-strange-side-effect-tp268053p268134.html Sent from the Emacs - Help mailing list archive at Nabble.com.