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: Jim Meyering
Subject: Re: diff-mode misinterprets empty lines.
Date: Wed, 05 Dec 2007 11:17:15 +0100

Paul Eggert <address@hidden> wrote:
> Stefan Monnier <address@hidden> writes:
>
>> Could you please revert this change?
>
> I did so, by installing the following patch into diffutils.  The old
> behavior (with trailing blanks) is now the default, and the new
> behavior (without them) is enabled only if the new
> --suppress-blank-empty option is given.
>
> However, the next POSIX version specifies a "diff -u" format in which
> those trailing blanks are optional, and apparently some "diff"
> implementations in the wild omit them even though no official or test
> version of GNU diff ever did.  So, as a practical matter, programs
> that parse "diff" output should not assume the trailing blanks are
> present, regardless of what GNU diff does.
>
> 2007-12-04  Paul Eggert  <address@hidden>
>
>       * NEWS: New diff option --suppress-blank-empty (no longer -u default).
>       * doc/diff.texi (Detailed Unified): Trailing spaces are no longer
>       omitted.
>       (Trailing Blanks): New section.
>       (diff Options) Mention new option.
>       * src/diff.h (suppress_blank_entry): New decl.
>       * src/context.c (pr_unidiff_hunk): Support --suppress-blank-empty.
>       * src/util.c (print_1_line): Likewise.
>       * src/diff.c (longopts, main, option_help_msgid): Likewise.
>       (SUPPRESS_BLANK_EMPTY_OPTION): New constant.

Hi Paul,

That looks fine.
Since I was thinking of using that new option always, I considered
changing the source to make the default in my private binary be to enable
the new option.  Since I'd rather not have to make private changes, what
do you think about having a compile-time option to change the default?
Not even a configure-time flag.

Since Emacs may eventually change to accept the new format, it may make
sense to change the default and to provide a --no-suppress-blank-empty
option.




reply via email to

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