[Top][All Lists]

[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 16:54:52 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

David Kastrup <address@hidden> writes:

> In environments that use diffs, trailing white space needs to be
> preserved.  Otherwise you could, for example, never have a diff that
> removes trailing white space.

Yes, of course, but the trailing white space you're talking about is
unaffected by the change, so this is not the issue here.  We are
talking only about trailing white space generated by the diff format
itself, not about trailing white space in the data.

> it is is wrong to interpret diff output with an
> unmodified trailing whitespace detection mode.

Not if --suppress-blank-empty is used.  With that option, all the
trailing white space will be about changes to data, which is normally
something I want to see.  It's much easier to see changings that
affect only trailing white space that way.  That is an advantage of
suppressing the blanks in question.

If Emacs could be improved to mark only important trailing white
space; then --suppress-blank-empty would be less useful (at least,
less useful to Emacs users).  But I don't see how to do that in
general, when diffs are mixed in with other text.

> The trailing white space is not unnecessary since it is part of the
> format.

Not necessarily.  diff outputs several formats.  The definition of the
format is up to us, and depends on utility; it is not carved in stone.
Unless you count draft POSIX as the "stone"; in that case, the
trailing blanks of diff -u format are indeed unnecessary.

> Would you be bothering
> messing with trailing whitespace in the first place if it was
> human-visible normally?

Yes.  Human-visible trailing white space was one of the motivations
for this change.

reply via email to

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