unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Join Multiple Lines
@ 2007-05-29  6:45 Ankur Jain
  2007-05-29  9:59 ` Peter Dyballa
  2007-05-29 20:26 ` Eric Hanchrow
  0 siblings, 2 replies; 7+ messages in thread
From: Ankur Jain @ 2007-05-29  6:45 UTC (permalink / raw)
  To: Gnu Emacs Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 283 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 346 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Join Multiple Lines
       [not found] <mailman.1383.1180430912.32220.help-gnu-emacs@gnu.org>
@ 2007-05-29  9:50 ` Pascal Bourguignon
       [not found] ` <1180527603.726755.118550@g4g2000hsf.googlegroups.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Pascal Bourguignon @ 2007-05-29  9:50 UTC (permalink / raw)
  To: help-gnu-emacs

"Ankur Jain" <jainankur@gmail.com> writes:
> 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?


You can do a search a replace on ^J.

M-x replace-string RET C-q C-j RET SPC RET

will put all the lines after the point on one big line.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.

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

* Re: Join Multiple Lines
  2007-05-29  6:45 Ankur Jain
@ 2007-05-29  9:59 ` Peter Dyballa
  2007-05-29 20:26 ` Eric Hanchrow
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2007-05-29  9:59 UTC (permalink / raw)
  To: Ankur Jain; +Cc: Gnu Emacs Mailing List


Am 29.05.2007 um 08:45 schrieb Ankur Jain:

> I know the command "join-line" to join the current line with  
> previous; how to do it for multiple lines?

Replace the line endings with a space: M-x replace-string RET C-q C-j  
RET SPC RET

--
Greetings

   Pete

The problem with the French is that they don't have a word for
«entrepreneur».                              - George W. Bush

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

* Re: Join Multiple Lines
  2007-05-29  6:45 Ankur Jain
  2007-05-29  9:59 ` Peter Dyballa
@ 2007-05-29 20:26 ` Eric Hanchrow
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Hanchrow @ 2007-05-29 20:26 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "Ankur" == Ankur Jain <jainankur@gmail.com> writes:

    Ankur> I know the command "join-line" to join the current line
    Ankur> with previous; how to do it for multiple lines?

Another option is to set your fill column to a large value, for
example

        M-1-0-0-0-0-0 C-x f

Then mark the lines and do M-x fill-region

-- 
Keaton, Chaplin, Garbo - let them now make room for Gromit.
        A. O. Scott, in The New York Times

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

* Re: Join Multiple Lines
       [not found] ` <1180527603.726755.118550@g4g2000hsf.googlegroups.com>
@ 2007-05-31  4:51   ` Ankur Jain
  2007-05-31  4:55     ` Ankur Jain
  0 siblings, 1 reply; 7+ messages in thread
From: Ankur Jain @ 2007-05-31  4:51 UTC (permalink / raw)
  To: weber, Gnu Emacs Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 1288 bytes --]

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 <hugows@gmail.com> wrote:
>
> 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)))))
>
>
>
>


-- 
Regards
Ankur Jain

http://ankurjain.org

[-- Attachment #1.2: Type: text/html, Size: 2644 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Join Multiple Lines
  2007-05-31  4:51   ` Ankur Jain
@ 2007-05-31  4:55     ` Ankur Jain
  2007-05-31 12:26       ` Hugo Schmitt
  0 siblings, 1 reply; 7+ messages in thread
From: Ankur Jain @ 2007-05-31  4:55 UTC (permalink / raw)
  To: weber, Gnu Emacs Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 1678 bytes --]

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 <jainankur@gmail.com> 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 < hugows@gmail.com> wrote:
> >
> > 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)))))
> >
> >
> >
> >
>
>
> --
> Regards
> Ankur Jain
>
> http://ankurjain.org




-- 
Regards
Ankur Jain

http://ankurjain.org

[-- Attachment #1.2: Type: text/html, Size: 3585 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Join Multiple Lines
  2007-05-31  4:55     ` Ankur Jain
@ 2007-05-31 12:26       ` Hugo Schmitt
  0 siblings, 0 replies; 7+ messages in thread
From: Hugo Schmitt @ 2007-05-31 12:26 UTC (permalink / raw)
  To: Ankur Jain; +Cc: Gnu Emacs Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 2075 bytes --]

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 <jainankur@gmail.com> 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 <jainankur@gmail.com> 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 < hugows@gmail.com> wrote:
> > >
> > > 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)))))
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Regards
> > Ankur Jain
> >
> > http://ankurjain.org
>
>
>
>
> --
> Regards
> Ankur Jain
>
> http://ankurjain.org
>

[-- Attachment #1.2: Type: text/html, Size: 4303 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

end of thread, other threads:[~2007-05-31 12:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1383.1180430912.32220.help-gnu-emacs@gnu.org>
2007-05-29  9:50 ` Join Multiple Lines Pascal Bourguignon
     [not found] ` <1180527603.726755.118550@g4g2000hsf.googlegroups.com>
2007-05-31  4:51   ` Ankur Jain
2007-05-31  4:55     ` Ankur Jain
2007-05-31 12:26       ` Hugo Schmitt
2007-05-29  6:45 Ankur Jain
2007-05-29  9:59 ` Peter Dyballa
2007-05-29 20:26 ` Eric Hanchrow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).