[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] delete-trailing-whitespace on active region
From: |
Deniz Dogan |
Subject: |
Re: [PATCH] delete-trailing-whitespace on active region |
Date: |
Fri, 11 Feb 2011 07:33:49 +0100 |
2011/2/11 Stefan Monnier <address@hidden>:
>>> + (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.
>
This patch is teaching me a lot...
Attached is a last attempt, if it's not good then I give up and hope
that someone else will take care of it.
Thanks,
Deniz Dogan
dtw3.patch
Description: Binary data
- [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, 2011/02/10
- Re: [PATCH] delete-trailing-whitespace on active region,
Deniz Dogan <=
- 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