all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* No copy-rectangle-as-kill?
@ 2005-06-01  9:50 Hattuari
  2005-06-01 10:58 ` Chris F.A. Johnson
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Hattuari @ 2005-06-01  9:50 UTC (permalink / raw)


Am I overlooking something, or is there no command in Emacs to copy a
rectangle into the last killed rectangle "special place" without also
removing it from the current buffer?  I gotta tell y'all, XEmacs has better
rectangle support than Emacs. ;)

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

* Re: No copy-rectangle-as-kill?
  2005-06-01  9:50 No copy-rectangle-as-kill? Hattuari
@ 2005-06-01 10:58 ` Chris F.A. Johnson
  2005-06-01 13:01   ` Mathias Dahl
  2005-06-01 13:12 ` optional
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Chris F.A. Johnson @ 2005-06-01 10:58 UTC (permalink / raw)


On Wed, 01 Jun 2005 at 09:50 GMT, Hattuari wrote:
> Am I overlooking something, or is there no command in Emacs to copy a
> rectangle into the last killed rectangle "special place" without also
> removing it from the current buffer?  I gotta tell y'all, XEmacs has better
> rectangle support than Emacs. ;)

(defun copy-rectangle-as-kill ()
    (interactive)
    (save-excursion
    (kill-rectangle (mark) (point))
    (exchange-point-and-mark)
    (yank-rectangle)))

-- 
    Chris F.A. Johnson                     <http://cfaj.freeshell.org>
    ==================================================================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
    <http://www.torfree.net/~chris/books/cfaj/ssr.html>

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

* Re: No copy-rectangle-as-kill?
  2005-06-01 10:58 ` Chris F.A. Johnson
@ 2005-06-01 13:01   ` Mathias Dahl
  0 siblings, 0 replies; 6+ messages in thread
From: Mathias Dahl @ 2005-06-01 13:01 UTC (permalink / raw)


"Chris F.A. Johnson" <cfajohnson@gmail.com> writes:

> On Wed, 01 Jun 2005 at 09:50 GMT, Hattuari wrote:
>> Am I overlooking something, or is there no command in Emacs to copy a
>> rectangle into the last killed rectangle "special place" without also
>> removing it from the current buffer?  I gotta tell y'all, XEmacs has better
>> rectangle support than Emacs. ;)
>
> (defun copy-rectangle-as-kill ()
>     (interactive)
>     (save-excursion
>     (kill-rectangle (mark) (point))
>     (exchange-point-and-mark)
>     (yank-rectangle)))

I like this better:

(defun copy-rectangle-as-kill (start end)
  "Copy rectangle with corners at point and mark; save as last killed one.
Calling from program, supply two args START and END, buffer positions.
But in programs you might prefer to use `extract-rectangle'."
  (interactive "r")
  (setq killed-rectangle (extract-rectangle start end))
  (message "Rectangle saved."))

It does not feel right to me messing with the buffer just to get a
copy of some of it.

/Mathias

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

* Re: No copy-rectangle-as-kill?
  2005-06-01  9:50 No copy-rectangle-as-kill? Hattuari
  2005-06-01 10:58 ` Chris F.A. Johnson
@ 2005-06-01 13:12 ` optional
  2005-06-01 16:01 ` Stefan Monnier
  2005-06-01 16:47 ` Holger Sparr
  3 siblings, 0 replies; 6+ messages in thread
From: optional @ 2005-06-01 13:12 UTC (permalink / raw)


You could try:

C-x r r R
C-x r i R

where R is a register name such as 'a', 'b', etc.  The first command
puts the rectange in the register named R and the second inserts the
rectange from register R.

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

* Re: No copy-rectangle-as-kill?
  2005-06-01  9:50 No copy-rectangle-as-kill? Hattuari
  2005-06-01 10:58 ` Chris F.A. Johnson
  2005-06-01 13:12 ` optional
@ 2005-06-01 16:01 ` Stefan Monnier
  2005-06-01 16:47 ` Holger Sparr
  3 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2005-06-01 16:01 UTC (permalink / raw)


> Am I overlooking something, or is there no command in Emacs to copy a
> rectangle into the last killed rectangle "special place" without also
> removing it from the current buffer?  I gotta tell y'all, XEmacs has better
> rectangle support than Emacs. ;)

Please send your request for enhancement via M-x report-emacs-bug
(and avoid the (X)Emacs cross-bashing because it doesn't put the maintainers
in a mood that lends itself to being nice to feature-requesters).


        Stefan

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

* Re: No copy-rectangle-as-kill?
  2005-06-01  9:50 No copy-rectangle-as-kill? Hattuari
                   ` (2 preceding siblings ...)
  2005-06-01 16:01 ` Stefan Monnier
@ 2005-06-01 16:47 ` Holger Sparr
  3 siblings, 0 replies; 6+ messages in thread
From: Holger Sparr @ 2005-06-01 16:47 UTC (permalink / raw)


On Wed, 01 Jun 2005, susudata@setidava.kushan.aa wrote:
> Am I overlooking something, or is there no command in Emacs to copy a
> rectangle into the last killed rectangle "special place" without also
> removing it from the current buffer?  I gotta tell y'all, XEmacs has
> better rectangle support than Emacs. ;)

There is also rect-mark.el . 

The commentary section tells:

;; You can also kill or copy rectangles onto the kill ring which is
;; convenient for yanking rectangles into ordinary buffers (i.e.  ones
;; not in picture mode) and for pasting rectangles into other window
;; system programs (e.g. xterm).  These keys are by default bound to
;; `C-x r C-w' and `C-x r M-w' by analogy to the normal kill and copy
;; counterparts.


-- 

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

end of thread, other threads:[~2005-06-01 16:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-01  9:50 No copy-rectangle-as-kill? Hattuari
2005-06-01 10:58 ` Chris F.A. Johnson
2005-06-01 13:01   ` Mathias Dahl
2005-06-01 13:12 ` optional
2005-06-01 16:01 ` Stefan Monnier
2005-06-01 16:47 ` Holger Sparr

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.