emacs-devel
[Top][All Lists]
Advanced

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

Re: diff-mode misinterprets empty lines.


From: Paul Eggert
Subject: Re: diff-mode misinterprets empty lines.
Date: Wed, 05 Dec 2007 09:45:59 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

David Kastrup <address@hidden> writes:

>> Too many tools these days can automatically remove trailing blanks.
>
> Why would you apply them to a _diff_?

We're beating a dead horse here, since the default behavior has been
changed back, but since you're interested in doing an autopsy....

I regularly apply many tools to a diff.  I use Emacs, and other text
editors.  I send diffs via email, and I store them as part of other
text files.  The most recent email I sent to this forum contained a
diff, for example.

In environments that use diffs a lot, trailing white space can cause
problems.  Here's one example.  Emacs has a way of highlighting
trailing white space.  This feature is a nice thing to have in
general, since it highlights white space that in some applications can
cause harm (C source code, makefiles, etc.) and that the user normally
cannot see.  But if 'diff' output contains unnecessary trailing white
space, the highlighted white space turns into false alarms on your
screen.  In general, a false alarm is a bad thing: either it causes
you to turn off the alarm mechanism, or it causes you to ignore
similar alarms in the future.  So that is at least one good motivation
for suppressing unnecessary trailing white space.

I'm not saying that it is always the right thing to suppress trailing
blanks; I'm only saying that there are good reasons to do so in some
cases.

By the way, the diff that I sent in my previous email
<http://lists.gnu.org/archive/html/bug-gnu-utils/2007-12/msg00026.html>
suppressed the trailing white space in question.  Did you notice?
I've used this format for many months now, for patches that I send via
email.  No problems have been reported with these patches.  And I send
out my fair share of patches.




reply via email to

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