help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: FR: Yank rectangle, not as a rectangle but as a string.


From: Teemu Likonen
Subject: Re: FR: Yank rectangle, not as a rectangle but as a string.
Date: Thu, 06 Mar 2014 09:26:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Jambunathan K. [2014-03-05 21:52:15 +05:30] wrote:

> FR: Yank rectangle, not as a rectangle but as a string.

I didn't read all your examples so I might not understand this
correctly. Anyway, I've written a command which sounds like what you
need. With prefix argument the command requests a separator string to be
inserted between rectangle rows. The default is space (" ").


(defun tl-yank-rectangle-sequentially (beg end char)
  ;; Variable "select-active-regions" must not be t.
  (interactive (list (region-beginning) (region-end)
                     (if current-prefix-arg
                         (read-string "Separator string: ")
                       " ")))
  (save-match-data
    (kill-new (mapconcat 'identity (extract-rectangle beg end) char))
    (setq deactivate-mark t)))

Attachment: pgpMMdEMKM_V6.pgp
Description: PGP signature


reply via email to

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