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: Herbert Euler
Subject: RE: remove extra whitespace on a line
Date: Sat, 02 Dec 2006 15:01:15 +0800

How about this?

(defun just-one-space-in-current-line (&optional n)
 (interactive "*p")
 (save-excursion
   (save-restriction
     (narrow-to-region (line-beginning-position)
                        (line-end-position))
     (goto-char (point-min))
     (while (re-search-forward "[ \t]" nil t)
        (just-one-space n)))))

Regards,
Guanpeng Xu


From: Greg Bognar <address@hidden>
To: address@hidden
Subject: remove extra whitespace on a line
Date: Sat, 02 Dec 2006 01:27:00 -0500

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?

Thanks,
Greg
_______________________________________________
help-gnu-emacs mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

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