|
From: | Ankur Jain |
Subject: | Re: Join Multiple Lines |
Date: | Thu, 31 May 2007 10:21:00 +0530 |
On 29 maio, 03:45, "Ankur Jain" < jainan...@gmail.com> wrote:
> Hi,
>
> How can I join multiple lines into one line using Emacs.
>
> I know the command "join-line" to join the current line with previous; how
> to do it for multiple lines?
>
> Can I execute it multiple times for a set of lines. If yes, please let me
> know how to do that?
>
> Regards
> Ankur Jain
I just wrote and tested this function.
Just mark the region and do a join-region.
Tell me if it helped,
-weber
(defun join-region (beg end)
"Apply join-line over region."
(interactive "r")
(if mark-active
(let ((beg (region-beginning))
(end (copy-marker (region-end))))
(goto-char beg)
(while (< (point) end)
(join-line 1)))))
[Prev in Thread] | Current Thread | [Next in Thread] |