[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal: diff-remove-trailing-blanks
From: |
Óscar Fuentes |
Subject: |
Re: Proposal: diff-remove-trailing-blanks |
Date: |
Thu, 01 May 2008 03:04:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt) |
Vinicius Jose Latorre <address@hidden> writes:
>>> (while (re-search-forward "^[+!>].*?[ \t]+$" (point-max) t)
>>>
>>
>> As every change indicator is followed by a white space in non-unified
>> format, this regexp matches every change on normal and context
>> formats. This is not bad, as the trailing whitespace condition is tested
>> again below for the source file, which is what matters. But then, you
>> could use a simpler regexp above ("^[+!>]", for instance), for behaving
>> the same with diff formats.
>>
>
> Ok, but the search in diff buffer is only for modified lines with
> trailing blanks,
> so there is less finds/replacements in the source file.
Precisely, my point is that non-unified format has a trailing blank for
empty new lines, even when the new line has no trailing blank. You can
check that yourself adding an empty new line to a file, diff it in
`context' or `normal' format and you can check that the diff has a blank
space after the `>' or `+'.
[snip]
>> Do you intend to install it on CVS soon?
>>
>
> Well, can I install diff-kill-trailing-whitespace
> and diff-show-trailing-whitespace into diff-mode?
The reason I would prefer diff-mode.el for those features, is that you
can also install a key sequence for it (I suggested C-c C-k). If you do
not receive authorization from an Emacs maintainer for adding the
functions to diff-mode, just rename them to whitespace-kill-from-diff or
something and install them in whitespace.el.
--
Oscar
- Re: Proposal: diff-remove-trailing-blanks, (continued)
- Re: Proposal: diff-remove-trailing-blanks, Vinicius Jose Latorre, 2008/04/26
- Re: Proposal: diff-remove-trailing-blanks, Óscar Fuentes, 2008/04/26
- Message not available
- Re: Proposal: diff-remove-trailing-blanks, Óscar Fuentes, 2008/04/26
- Re: Proposal: diff-remove-trailing-blanks, Vinicius Jose Latorre, 2008/04/26
- Re: Proposal: diff-remove-trailing-blanks, Vinicius Jose Latorre, 2008/04/26
- Re: Proposal: diff-remove-trailing-blanks, Óscar Fuentes, 2008/04/27
- Message not available
- Message not available
- Re: Proposal: diff-remove-trailing-blanks, Óscar Fuentes, 2008/04/27
- Re: Proposal: diff-remove-trailing-blanks, Vinicius Jose Latorre, 2008/04/27
- Re: Proposal: diff-remove-trailing-blanks, Óscar Fuentes, 2008/04/27
- Re: Proposal: diff-remove-trailing-blanks, Vinicius Jose Latorre, 2008/04/30
- Re: Proposal: diff-remove-trailing-blanks,
Óscar Fuentes <=