GNU bug report logs - #54034
29.0.50; Diff prettify broken for empty files

Previous Next

Package: emacs;

Reported by: Matthias Meulien <orontee <at> gmail.com>

Date: Thu, 17 Feb 2022 07:49:02 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Matthias Meulien <orontee <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: "Basil L. Contovounesios" <contovob <at> tcd.ie>, 54034 <at> debbugs.gnu.org
Subject: bug#54034: 29.0.50; Diff prettify broken for empty files
Date: Wed, 29 Jun 2022 20:22:00 +0200
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> [ It'd have been better to file a new bug report for this one, FWIW.  ]
>
> I installed the patch below, which seems safe, but is probably
> not optimal.  Matthias?

Wouldn't it be safer to simply disable prettification of the "diff
header" when diff-buffer-type isn't equal to git?

In case of the output of the command diff-buffers, I don't see what
would be a usefull prettification of that header.

For other cases, back in 2018 you wrote that "This has only been tested
with Git's diff output."  (and I extended diff--font-lock-prettify
without testing other outputs as Git's).  Note also that prettification
was already broken with emacs 27.1.  See the attached screenshot where
--- #<buffer *Messages*> has one of its minus sign in the fringe when
diff-font-lock-prettify is t.  (Your patch fixed that!)

[Capture d’écran du 2022-06-29 19-43-23.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
So I guess it won't make any harm to support "diff header"
prettification for Git diff output only: 

[0001-Disable-prettification-of-diff-header-for-non-Git-di.patch (text/x-diff, attachment)]
[Message part 5 (text/plain, inline)]
Then it would be possible to introduce a new value for diff-buffer-type,
dedicated to diff-buffers output, and provide a nice prettification
dedicated to that case 🤔 Would a single line like "Differences between buffer
*Help* and *scratch*" be a good idea?
-- 
Matthias

This bug report was last modified 2 years and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.