[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] delete-trailing-whitespace on active region
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] delete-trailing-whitespace on active region |
Date: |
Thu, 10 Feb 2011 21:10:56 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
>> + (while (re-search-forward "\\s-$" end t)
>> + (skip-syntax-backward "-" (save-excursion (forward-line 0) (point)))
>> + ;; Don't delete formfeeds, even if they are considered whitespace.
>> + (save-match-data
>> + (if (looking-at ".*\f")
>> + (goto-char (match-end 0))))
>> + (delete-region (point) (match-end 0))))))
> You can't use the value of `end' to limit the search like that, since
> the deletion changes the size of the region. (Use narrowing or a
> marker.)
Good point, thanks. ...or do it from the end.
Stefan
- [PATCH] delete-trailing-whitespace on active region, Deniz Dogan, 2011/02/09
- Re: [PATCH] delete-trailing-whitespace on active region, Stefan Monnier, 2011/02/09
- Re: [PATCH] delete-trailing-whitespace on active region, Deniz Dogan, 2011/02/10
- Re: [PATCH] delete-trailing-whitespace on active region, Stefan Monnier, 2011/02/10
- Re: [PATCH] delete-trailing-whitespace on active region, Johan Bockgård, 2011/02/10
- Re: [PATCH] delete-trailing-whitespace on active region,
Stefan Monnier <=
- Re: [PATCH] delete-trailing-whitespace on active region, Deniz Dogan, 2011/02/11
- Re: [PATCH] delete-trailing-whitespace on active region, Stefan Monnier, 2011/02/11
- Re: [PATCH] delete-trailing-whitespace on active region, Deniz Dogan, 2011/02/11