unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: 2rb1 <tvh@fritid.tele.dk>
To: Help-gnu-emacs@gnu.org
Subject: Re: Copy rectangle - strange side effect
Date: Fri, 26 Oct 2012 04:31:46 -0700 (PDT)	[thread overview]
Message-ID: <1351251106755-268134.post@n5.nabble.com> (raw)
In-Reply-To: <1351203865925-268100.post@n5.nabble.com>

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.



      reply	other threads:[~2012-10-26 11:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 15:48 Copy rectangle - strange side effect 2rb1
2012-10-25 20:34 ` Peter Dyballa
2012-10-25 22:24   ` 2rb1
2012-10-26 11:31     ` 2rb1 [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1351251106755-268134.post@n5.nabble.com \
    --to=tvh@fritid.tele.dk \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).