[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kill-rectangle, yank-rectangle and copy-rectangle

From: Raymond Zeitler
Subject: Re: kill-rectangle, yank-rectangle and copy-rectangle
Date: Tue, 28 Aug 2001 19:54:03 GMT
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

jsykari@cc.hut.fi (Antti Sykäri) writes:

> Hello,
> I found that GNU Emacs, version 20.7.2, has commands kill-rectangle and
> yank-rectangle, but it is missing a command which would copy a rectangle. I
> think that having one would be more consistent; copying rectangular regions
> should implemented as well as copying normal regions (M-w).
> Now you would have to do the following in order to copy a rectangular
> region:
> <Select a region>
> C-x r k          ; kill the region
> <Go to upper left corner of the place where the region was>
> C-x r y          ; copy the region back
> and then do whatever you wanted to do with the copied rectangle in the first
> place.
> A friend of mine worked around this with the following kludge:
> (defun copy-rectangle (start end) (interactive "r")
>   (let ((point (point)))
>     (kill-rectangle start end) (goto-char start)
>     (yank-rectangle) (goto-char point)))
> Of course, real implementation might be something similar to kill-region (I
> haven't looked into the elisp code.)
> I also am of the humble opinion that the keyboard commands for those two
> were set somewhat non-sensibly. Currently these keys are:
> C-x r k     kill-rectangle
> C-x r y     yank-rectangle
> I would find it much more logical and consistent if these would be,
> for example (this is how I configured them since I don't want to learn
> two sets for keys for cut'n'paste):
> C-x r M-w   copy-rectangle
> C-x r C-y   yank-rectangle
> C-x r C-w   kill-rectangle
> These are similar to M-w (copy), C-w (kill) and C-y (paste).


Yes, I agree with what you say, especially concerning the key

Right now, when i do a copy, I usually C-x r r 1, and then instead of
yanking, do C-x r i 1.  It's annoying.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]