unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to copy rectangles
@ 2003-10-09 20:50 Siegfried Heintze
  2003-10-11 18:37 ` roodwriter
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Siegfried Heintze @ 2003-10-09 20:50 UTC (permalink / raw)


There is a nice yank-rectangle command -- I really like it.

My problem is that there is only a kill-rectangle command. Why is there no
kill-rectangle-save command? I need it!

I can copy a rectangle to a register with copy-rectangle command, but how do
I extract it from the register? There is no insert-rectangle command. I
guess insert-register works. Well anyway, does anyone have a
kill-rectangle-save command I could have? Was it omitted intentionally?

  Thanks for the good work you guys!
  Sieg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to copy rectangles
  2003-10-09 20:50 How to copy rectangles Siegfried Heintze
@ 2003-10-11 18:37 ` roodwriter
  2003-10-11 21:47 ` Martin Stone Davis
  2003-10-13 12:34 ` Gareth Rees
  2 siblings, 0 replies; 7+ messages in thread
From: roodwriter @ 2003-10-11 18:37 UTC (permalink / raw)


Siegfried Heintze wrote:

> There is a nice yank-rectangle command -- I really like it.
> 
> My problem is that there is only a kill-rectangle command. Why is there no
> kill-rectangle-save command? I need it!
> 
> I can copy a rectangle to a register with copy-rectangle command, but how
> do I extract it from the register? There is no insert-rectangle command. I
> guess insert-register works. Well anyway, does anyone have a
> kill-rectangle-save command I could have? Was it omitted intentionally?
> 
>   Thanks for the good work you guys!
>   Sieg


I was just looking at the date on your posting. I wasn't planning to answer 
it because I don't know of one. But the thought occurred to me that maybe 
that's the reason no one else has answered.

Just a thought: Would it be easier for you to make a macro with a different 
keybinding to insert the rectangle to and from your register? Would that 
simplify things?

I did something similar with query-replace. It's easier for me to type C-c q 
than M-%. Sometimes there are better shortcuts.

For what it's worth.

--Rod

-- 
Author of "Linux for Non-Geeks--Clear-eyed Answered for Practical Consumers" 
and "Boring Stories from Uncle Rod." Both are available at 
http://www.rodwriterpublishing.com/index.html

To reply by e-mail, take the extra "o" out of the name.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to copy rectangles
  2003-10-09 20:50 How to copy rectangles Siegfried Heintze
  2003-10-11 18:37 ` roodwriter
@ 2003-10-11 21:47 ` Martin Stone Davis
  2003-10-13 12:34 ` Gareth Rees
  2 siblings, 0 replies; 7+ messages in thread
From: Martin Stone Davis @ 2003-10-11 21:47 UTC (permalink / raw)


Siegfried Heintze wrote:

> There is a nice yank-rectangle command -- I really like it.
> 
> My problem is that there is only a kill-rectangle command. Why is there no
> kill-rectangle-save command? I need it!

Have you tried cua.el?

http://www.cua.dk/cua.html

-Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to copy rectangles
  2003-10-09 20:50 How to copy rectangles Siegfried Heintze
  2003-10-11 18:37 ` roodwriter
  2003-10-11 21:47 ` Martin Stone Davis
@ 2003-10-13 12:34 ` Gareth Rees
  2003-10-14 16:54   ` Sandip Chitale
  2 siblings, 1 reply; 7+ messages in thread
From: Gareth Rees @ 2003-10-13 12:34 UTC (permalink / raw)


Siegfried Heintze wrote:
> Why is there no kill-rectangle-save command? I need it!

Because you can use 'copy-rectangle-to-register' (C-x r r REGISTER) to
save a copy, and 'insert-register' (C-x r i REGISTER) to insert it.

However, it's easy to roll your own:

    (defun kill-rectangle-save (start end)
      "Save the region-rectangle as the last killed one."
      (interactive "r")
      (require 'rect)  ; Make sure killed-rectangle is defvar'ed.
      (setq killed-rectangle (extract-rectangle start end)))

-- 
Gareth Rees

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to copy rectangles
  2003-10-13 12:34 ` Gareth Rees
@ 2003-10-14 16:54   ` Sandip Chitale
  2003-10-15 10:03     ` Gareth Rees
  0 siblings, 1 reply; 7+ messages in thread
From: Sandip Chitale @ 2003-10-14 16:54 UTC (permalink / raw)


gareth.rees@pobox.com (Gareth Rees) wrote in message news:<e867ce6d.0310130434.2da5327c@posting.google.com>...
> Siegfried Heintze wrote:
> > Why is there no kill-rectangle-save command? I need it!
> 
> Because you can use 'copy-rectangle-to-register' (C-x r r REGISTER) to
> save a copy, and 'insert-register' (C-x r i REGISTER) to insert it.
> 
> However, it's easy to roll your own:
> 
>     (defun kill-rectangle-save (start end)
>       "Save the region-rectangle as the last killed one."
>       (interactive "r")
>       (require 'rect)  ; Make sure killed-rectangle is defvar'ed.
>       (setq killed-rectangle (extract-rectangle start end)))

Thanks. I have added the above function to my .emacs now.

Can anyone tell me as to why this is not supported by emacs by
default? One would think this is very useful and commonly used
function.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to copy rectangles
  2003-10-14 16:54   ` Sandip Chitale
@ 2003-10-15 10:03     ` Gareth Rees
  2003-10-15 18:14       ` Sandip Chitale
  0 siblings, 1 reply; 7+ messages in thread
From: Gareth Rees @ 2003-10-15 10:03 UTC (permalink / raw)


Sandip Chitale:
> Can anyone tell me as to why [kill-rectangle-save] is not supported by
> Emacs by default? One would think this is very useful and commonly
> used function.

I don't know.  It's probably an oversight.  Why not report it (use M-x
report-emacs-bug) or submit a patch?  The hardest part of implementing
it would be to pick a good default keybinding (perhaps 'C-x r C-w' or
'C-x r M-w'?).

-- 
Gareth Rees   http://www.garethrees.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to copy rectangles
  2003-10-15 10:03     ` Gareth Rees
@ 2003-10-15 18:14       ` Sandip Chitale
  0 siblings, 0 replies; 7+ messages in thread
From: Sandip Chitale @ 2003-10-15 18:14 UTC (permalink / raw)


gareth.rees@pobox.com (Gareth Rees) wrote in message news:<e867ce6d.0310150203.309dbbcf@posting.google.com>...
> Sandip Chitale:
> > Can anyone tell me as to why [kill-rectangle-save] is not supported by
> > Emacs by default? One would think this is very useful and commonly
> > used function.
> 
> I don't know.  It's probably an oversight.  Why not report it (use M-x
> report-emacs-bug) or submit a patch?  The hardest part of implementing
> it would be to pick a good default keybinding (perhaps 'C-x r C-w' or
> 'C-x r M-w'?).

I have sent the following bug report to bug-gnu-emacs@gnu.org:

There is copy-rectangle-to-register but no mechanism to copy
rectangle to kill ring which can be pasted using 

C-x r y (i.e. yank-rectangle)

However there is no kill-rectangle-save which is along the lines of
kill-ring-save except it applies to rectangle.

Proposed key binding:

C-x r M-w.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-10-15 18:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-09 20:50 How to copy rectangles Siegfried Heintze
2003-10-11 18:37 ` roodwriter
2003-10-11 21:47 ` Martin Stone Davis
2003-10-13 12:34 ` Gareth Rees
2003-10-14 16:54   ` Sandip Chitale
2003-10-15 10:03     ` Gareth Rees
2003-10-15 18:14       ` Sandip Chitale

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).