[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] delete-trailing-whitespace on active region
From: |
Johan Bockgård |
Subject: |
Re: [PATCH] delete-trailing-whitespace on active region |
Date: |
Thu, 10 Feb 2011 22:31:04 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Deniz Dogan <address@hidden> writes:
> + (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.)
- [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 <=
- Re: [PATCH] delete-trailing-whitespace on active region, Stefan Monnier, 2011/02/10
- 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