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

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

Re: Join Multiple Lines


From: Hugo Schmitt
Subject: Re: Join Multiple Lines
Date: Thu, 31 May 2007 09:26:18 -0300

I don't know, but I feel it's too simple to be added by default... People usually have tons of those little functions loaded when they start emacs, I just keep collecting them!
Cheers,
weber

On 5/31/07, Ankur Jain <address@hidden> wrote:
I apologize....I pasted wrongly...it's working perfectly....great feature...

can you try to get this function available by default in future emacs version?

Regards
Ankur Jain


On 5/31/07, Ankur Jain <address@hidden> wrote:
Hi weber,

I pasted this code in my .emacs and restarted Emacs. I got the following error :

Symbol's value as variable is void: On

To ensure normal operation, you should investigate the cause of the error in your initialization file and remove it.  Start Emacs with the `--debug-init' option to view a complete error backtrace


Thanks
Ankur



On 5/30/07, weber < address@hidden> wrote:
On 29 maio, 03:45, "Ankur Jain" < address@hidden> 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)))))






--
Regards
Ankur Jain

http://ankurjain.org



--
Regards
Ankur Jain

http://ankurjain.org


reply via email to

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