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

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

Re: remove extra whitespace on a line


From: Dieter Wilhelm
Subject: Re: remove extra whitespace on a line
Date: Sat, 02 Dec 2006 09:43:04 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Eric Hanchrow <offby1@blarg.net> writes:

>     Suppose     I    have   a   line  like   this.
>     How can I remove the extra spaces from the line?  So that I end up with
>     this:
>
>     Suppose I have a line like this.
>
>     Exactly like fill-paragraph, but I do not want to "fill" the paragraph,
>     only the current line.  Is there an Emacs function to do this?
>
> Not that I know of, but it'd be very easy to create one with a macro,
> or Emacs Lisp.
>
> Just narrow to the line, then fill paragraph.

Good idea!  Another idea is:

Mark line:

  C-a C-SPC C-n

Then replace whitespace:

  C-M-% " +" RET " " !

Your idea in comparison (after marking):

  C-x n n M-q C-x n w

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany




reply via email to

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