[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Wed, 10 Jan 2007 23:14:09 -0700
Thunderbird 188.8.131.52 (Macintosh/20061207)
Kevin Rodgers wrote:
Wilmar Igl wrote:
sorry, I don't want to be a nuisance. However, I'd like to suggest to
include a function to copy a rectangle into the kill ring which is not
available at the moment (only copy-rectangle-to-register).
Do you mean "copy a rectangle so that `C-x r y' can insert it"? Or do
you mean "copy a rectangle so that `C-y' can insert it"?
If the former, this should do the job:
(defun copy-rectangle-as-kill (beg end)
"Copy rectangular region into `killed-rectangle', but don't delete it.
The rectangle can then be yanked via \\[yank-rectangle]."
(setq killed-rectangle (extract-rectangle beg end)))
Or if the latter, how about:
(defun copy-rectangle-as-kill-region (beg end)
"Copy rectangular region into the kill ring, but don't delete it.
The text can then be yanked via \\[yank]."
;; Based on copy-region-as-kill, but with no filtering:
(let ((text (mapconcat 'identity (extract-rectangle beg end) "\n")))
(if (eq last-command 'kill-region)
(kill-append text (< end beg))
(setq deactivate-mark t))
Denver, Colorado, USA