unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc: Ted Zlatanov <tzz@lifelogs.com>, emacs-devel@gnu.org
Subject: Re: emacs doc changes
Date: Wed, 19 Apr 2006 21:34:41 +0300	[thread overview]
Message-ID: <20060419183441.GA3137@gothmog.pc> (raw)
In-Reply-To: <85bquxfn3j.fsf@lola.goethe.zz>

On 2006-04-19 20:15, David Kastrup <dak@gnu.org> wrote:
>Ted Zlatanov <tzz@lifelogs.com> writes:
>> On 19 Apr 2006, dak@gnu.org wrote:
>>> Is there a reason not to use unified diffs ("diff -u") when
>>> available?  Of course, not all diff programs can provide them, but
>>> GNU diff does, and patch understands them just as well, and I find
>>> it quite more human-readable (if I consider myself representative
>>> for a human, that is).
>>
>> RMS has asked me for context diffs before, so I'm guessing unified
>> patches are less useful to Emacs maintainers...
>
> I am not sure about that: maybe it is just because not all diff
> programs can deliver unified.  That's why I was asking Eli.
>
>> I can provide -u as well, since I would just do "cvs diff -u"
>> instead of "cvs diff -c".
>
> Well, context diffs certainly are fine enough for use with "patch", so
> there is little reason to post another batch because of that.  I was
> more asking about a general policy.
>
> I have actually customized `diff-switches' to "-u" myself, and it
> would be interesting to hear whether that could cause trouble in any
> way when cooperating with other people.

I think that `context diffs' (poorly named, since -u diffs have context
too, if you ask me), are preferable in some situations.  Mostly when
whole blocks of text change in ways that also include re-indenting
and/or re-formatting of the text.

In the FreeBSD source tree, we prefer seeing unified diffs, but we also
encourage people not to re-wrap or otherwise re-indent code unless
strictly necessary.  This can be harder to read when Elisp source code
changes are part of the diff though, i.e.

|    (when (memq t (mapcar (lambda (buffer)
|                            (with-current-buffer buffer
|                              show-paren-mode))
|                          (buffer-list)))
|      (setq show-paren-idle-timer (run-with-idle-timer
|-                                  show-paren-delay t
|-                                  'old-show-paren-function)))
|+                                  show-paren-delay nil
|+                                  'show-paren-function)))

I can easily think of unified diffs getting *very* ugly with lots of
changes around a loop with several nesting levels.  A "diff -c" patch
tends to group blocks of code in separate areas, marked with '!', so
this would be:

|    (when (memq t (mapcar (lambda (buffer)
|                            (with-current-buffer buffer
|                              show-paren-mode))
|                          (buffer-list)))
|      (setq show-paren-idle-timer (run-with-idle-timer
|!                                  show-paren-delay t
|!                                  'old-show-paren-function)))
|-----------
|    (when (memq t (mapcar (lambda (buffer)
|                            (with-current-buffer buffer
|                              show-paren-mode))
|                          (buffer-list)))
|      (setq show-paren-idle-timer (run-with-idle-timer
|+                                  show-paren-delay nil
|+                                  'show-paren-function)))

Being slightly more verbose, this patch lets one quickly look at the
entire "new loop" without having to mentally "context switch" between
reading only the '-' lines or only the '+' lines.

But I'm just guessing here at why Emacs people prefer "diff -c" patches.

- Giorgos

  reply	other threads:[~2006-04-19 18:34 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-12 21:41 emacs-Xtra Nick Roberts
2006-04-13  3:20 ` emacs-Xtra Richard Stallman
2006-04-13  4:14   ` emacs-Xtra Nick Roberts
2006-04-13  7:10     ` emacs-Xtra Nic
2006-04-13  9:02       ` emacs-Xtra Eli Zaretskii
2006-04-14  4:18       ` emacs-Xtra Richard Stallman
2006-04-14 22:21         ` emacs-Xtra Nic
2006-04-15 17:33           ` emacs-Xtra Richard Stallman
2006-04-13 18:40     ` emacs-Xtra Ted Zlatanov
2006-04-14  7:43       ` emacs-Xtra Eli Zaretskii
2006-04-14 13:39         ` emacs-Xtra Ted Zlatanov
2006-04-14 14:40           ` emacs-Xtra Eli Zaretskii
2006-04-14 16:05             ` emacs-Xtra Ted Zlatanov
2006-04-14 16:54               ` emacs-Xtra Eli Zaretskii
2006-04-15 17:32               ` emacs-Xtra Richard Stallman
2006-04-15 18:09                 ` emacs-Xtra David Kastrup
2006-04-18 15:03                 ` emacs-Xtra Ted Zlatanov
2006-04-19  4:17                   ` emacs-Xtra Richard Stallman
2006-04-19 16:34                     ` emacs doc changes (was: emacs-Xtra) Ted Zlatanov
2006-04-19 17:38                       ` emacs doc changes Ted Zlatanov
2006-04-19 17:51                       ` emacs doc changes (was: emacs-Xtra) Eli Zaretskii
2006-04-19 17:57                         ` emacs doc changes David Kastrup
2006-04-19 18:01                           ` Ted Zlatanov
2006-04-19 18:15                             ` David Kastrup
2006-04-19 18:34                               ` Giorgos Keramidas [this message]
2006-04-19 20:44                                 ` Stefan Monnier
2006-04-20  9:50                                   ` Eli Zaretskii
2006-04-20  9:58                                     ` David Kastrup
2006-04-20 10:13                                       ` Eli Zaretskii
2006-04-20 19:38                                         ` Richard Stallman
2006-04-20 21:09                                           ` Stefan Monnier
2006-04-27 14:42                                             ` Richard Stallman
2006-04-30 15:29                                               ` Stefan Monnier
2006-05-01  4:19                                                 ` Richard Stallman
2006-05-01 12:39                                                   ` Stefan Monnier
2006-05-02  2:05                                                     ` Richard Stallman
2006-05-11 23:06                                                       ` Aaron S. Hawley
2006-04-20 10:25                               ` Eli Zaretskii
2006-04-20  1:14                           ` Richard Stallman
2006-04-20 13:43                             ` Jay Belanger
2006-04-20  9:15                           ` Eli Zaretskii
2006-04-20  9:21                             ` David Kastrup
2006-04-19 17:58                         ` Ted Zlatanov
2006-04-25 16:48                           ` Richard Stallman
2006-04-15 17:32           ` emacs-Xtra Richard Stallman
2006-04-14 16:15       ` emacs-Xtra Richard Stallman
2006-04-14  4:18     ` emacs-Xtra Richard Stallman
2006-04-13  8:28 ` emacs-Xtra Eli Zaretskii
2006-04-13 18:40   ` emacs-Xtra Glenn Morris
2006-04-14  7:35     ` emacs-Xtra Eli Zaretskii
2006-04-14  4:18   ` emacs-Xtra Richard Stallman
2006-04-14  8:16     ` emacs-Xtra Eli Zaretskii
2006-04-21 11:43     ` emacs-Xtra Eli Zaretskii
2006-04-21 21:05       ` emacs-Xtra Richard Stallman
2006-04-14  4:18   ` emacs-Xtra Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20060419183441.GA3137@gothmog.pc \
    --to=keramida@ceid.upatras.gr \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).