all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Paul Eggert <eggert@CS.UCLA.EDU>
Cc: rms@gnu.org, bug-gnu-utils@gnu.org,
	Jim Meyering <jim@meyering.net>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: diff-mode misinterprets empty lines.
Date: Wed, 05 Dec 2007 19:12:23 +0100	[thread overview]
Message-ID: <85d4tlt3i0.fsf@lola.goethe.zz> (raw)
In-Reply-To: <87hcix827c.fsf@penguin.cs.ucla.edu> (Paul Eggert's message of "Wed, 05 Dec 2007 09:45:59 -0800")

Paul Eggert <eggert@CS.UCLA.EDU> writes:

> David Kastrup <dak@gnu.org> 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.

No.  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.

What _you_ mean is that in environments that _don't_ use diffs but
rather interpret them as naked text, inconveniences might occur.  But
those will occur with any patch dealing with trailing white space in any
manner, anyhow.

> 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.

Which only means that it is is wrong to interpret diff output with an
unmodified trailing whitespace detection mode.  Because diff files are
not merely text.  They carry a meaning.

> So that is at least one good motivation for suppressing unnecessary
> trailing white space.

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

> 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.

diff-mode clearly is not such a one.

> 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 happen not to be a program.  If I had used Emacs for actually dealing
with the diff, I would have noticed.

Isn't it quite nonsensical to ask this question?  Would you be bothering
messing with trailing whitespace in the first place if it was
human-visible normally?

> I've used this format for many months now, for patches that I send via
> email.  No problems have been reported with these patches.

You mean, the mailing list thread on the Emacs developer list (which the
request to change this back originated on) is just a figment of my
imagination?  No problem report triggered it?

> And I send out my fair share of patches.

The "patch" program deals with this format violation.  Not everything
else does, and people often repair patches instead of reporting them.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




  reply	other threads:[~2007-12-05 18:12 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29  1:03 diff-mode misinterprets empty lines Richard Stallman
2007-11-29  9:26 ` David Kastrup
2007-11-29 16:09   ` Stefan Monnier
2007-12-05  7:35     ` Paul Eggert
2007-12-05 10:17       ` Jim Meyering
2007-12-05 10:58         ` David Kastrup
2007-12-05 11:27           ` Jim Meyering
2007-12-05 12:33             ` Andreas Schwab
2007-12-05 12:39               ` Jim Meyering
2007-12-05 14:59             ` David Kastrup
2007-12-05 17:45               ` Paul Eggert
2007-12-05 18:12                 ` David Kastrup [this message]
2007-12-06  0:54                   ` Paul Eggert
2007-12-06 10:11                     ` Andreas Schwab
2007-12-05 21:04                 ` Juanma Barranquero
2007-12-06 15:39                   ` Stefan Monnier
2008-01-06  0:15                     ` Glenn Morris
2008-01-06 18:09                       ` Richard Stallman
2008-01-14 21:08                       ` Stefan Monnier
2008-01-14 21:38                         ` Glenn Morris
2008-01-14 22:46                           ` Glenn Morris
2008-01-14 23:35                             ` Diffs between %s and %s end here (was: diff-mode misinterprets empty lines.) Reiner Steib
2008-01-15  3:29                               ` Diffs between %s and %s end here Miles Bader
2008-01-16  8:13                                 ` Glenn Morris
2008-01-15  0:09                             ` diff-mode misinterprets empty lines Dan Nicolaescu
2008-01-29 18:37                         ` Chong Yidong
2008-02-19 16:32                           ` Stefan Monnier
2008-02-19 20:44                             ` Stefan Monnier
2007-12-06  2:11               ` Richard Stallman
2007-12-05 17:48         ` Paul Eggert
2007-12-05 17:50           ` Jim Meyering
2007-11-29 22:31   ` Richard Stallman
2007-11-29 23:12     ` David Kastrup
2007-11-30  2:03     ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2007-11-27 18:04 Sergei Organov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85d4tlt3i0.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=bug-gnu-utils@gnu.org \
    --cc=eggert@CS.UCLA.EDU \
    --cc=emacs-devel@gnu.org \
    --cc=jim@meyering.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.