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

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

Re: Deleting chunks of whitespace


From: Ehud Karni
Subject: Re: Deleting chunks of whitespace
Date: Mon, 18 Nov 2002 20:07:24 +0200

On 18 Nov 2002 08:26:55 -0800, rvmolen@bambecksystems.com (Richard V. Molen) 
wrote:
> 
> Thank you Ehud, this works nicely and does 95% of what I want.  And
> it's done with simple, resuable functions.
> 
> The remaining 5% occurs at the end of the buffer when there is still a
> word and maybe some extra newlines remaining.  Of course, this doesn't
> occur often and a couple of C-k's would clean it right up.

This is very easy to fix (change the `t' to `1' in the 3rd arg to
`re-search-forward', see its help) like this:

(defun forward-to-non-blank ()
  "go to 1st non blank (after blank) to right,
if there is none go to end of buffer"
  (interactive)
       (if (re-search-forward "[ \t\n][^ \t\n]" (point-max) 1)  
           (backward-char 1)))
                                                                   
Ehud.


-- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry




reply via email to

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