From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Meyering Newsgroups: gmane.comp.gnu.utils.bugs,gmane.emacs.devel Subject: Re: diff-mode misinterprets empty lines. Date: Wed, 05 Dec 2007 11:17:15 +0100 Message-ID: <878x494f9w.fsf@rho.meyering.net> References: <85ir3l767y.fsf@lola.goethe.zz> <87ir3d1tn7.fsf@penguin.cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196849890 23972 80.91.229.12 (5 Dec 2007 10:18:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2007 10:18:10 +0000 (UTC) Cc: emacs-devel@gnu.org, bug-gnu-utils@gnu.org, Stefan Monnier , rms@gnu.org To: Paul Eggert Original-X-From: bug-gnu-utils-bounces+gnu-bug-gnu-utils=m.gmane.org@gnu.org Wed Dec 05 11:18:19 2007 Return-path: Envelope-to: gnu-bug-gnu-utils@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IzrKV-0003TW-Eo for gnu-bug-gnu-utils@m.gmane.org; Wed, 05 Dec 2007 11:18:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzrKE-0000tC-P2 for gnu-bug-gnu-utils@m.gmane.org; Wed, 05 Dec 2007 05:17:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IzrJj-0000K6-Ho for bug-gnu-utils@gnu.org; Wed, 05 Dec 2007 05:17:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IzrJi-0000Hp-1F for bug-gnu-utils@gnu.org; Wed, 05 Dec 2007 05:17:22 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzrJh-0000Ha-SJ; Wed, 05 Dec 2007 05:17:21 -0500 Original-Received: from smtp3-g19.free.fr ([212.27.42.29]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IzrJd-0003Mq-1V; Wed, 05 Dec 2007 05:17:17 -0500 Original-Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 3B0B117B5B3; Wed, 5 Dec 2007 11:17:16 +0100 (CET) Original-Received: from mx.meyering.net (mx.meyering.net [82.230.74.64]) by smtp3-g19.free.fr (Postfix) with ESMTP id 1F1FD17B5AF; Wed, 5 Dec 2007 11:17:15 +0100 (CET) Original-Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id D1E9A266F9; Wed, 5 Dec 2007 11:17:15 +0100 (CET) In-Reply-To: <87ir3d1tn7.fsf@penguin.cs.ucla.edu> (Paul Eggert's message of "Tue, 04 Dec 2007 23:35:08 -0800") Original-Lines: 42 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-utils@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports for the GNU utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-utils-bounces+gnu-bug-gnu-utils=m.gmane.org@gnu.org Errors-To: bug-gnu-utils-bounces+gnu-bug-gnu-utils=m.gmane.org@gnu.org Xref: news.gmane.org gmane.comp.gnu.utils.bugs:15303 gmane.emacs.devel:84723 Archived-At: Paul Eggert wrote: > Stefan Monnier 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 > > * 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.