[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: remove extra whitespace on a line
From: |
Markus Triska |
Subject: |
Re: remove extra whitespace on a line |
Date: |
Sat, 02 Dec 2006 18:58:03 +0100 |
Greg Bognar <greg.bognar@gmail.com> writes:
>
> So this is what I want, isn't it?
>
> (defun just-one-space-in-current-line ()
> (interactive)
> (save-excursion
> (save-restriction
> (narrow-to-region (line-beginning-position)
> (line-end-position))
> (goto-char (point-min))
> (canonically-space-region
> (line-beginning-position) (line-end-position)))))
I recommend:
(defun just-one-space-in-current-line ()
(interactive)
(save-excursion
(fill-region (line-beginning-position) (line-end-position))))
All the best,
Markus Triska