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: 54034 <at> debbugs.gnu.org
Subject: bug#54034: 29.0.50; Diff prettify broken for empty files
Date: Thu, 07 Apr 2022 00:51:37 +0200
[Message part 1 (text/plain, inline)]
Hi Stefan,

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> Of course, there's always the problem that this prettification
> hides info, so there's a tension here.

Here is a patch that capture file mode information and displays that
information.

Screenshot:

[Capture d’écran du 2022-04-07 00-36-38.png (image/png, inline)]
[0001-Display-file-mode-information-when-diff-font-lock-pr.patch (text/x-diff, inline)]
From 09d1fa92b73ce956e75608f1a8a4c9fee8e7ca70 Mon Sep 17 00:00:00 2001
From: Matthias Meulien <orontee <at> gmail.com>
Date: Thu, 7 Apr 2022 00:47:31 +0200
Subject: [PATCH] Display file mode information when diff font lock prettify
 enabled

* lisp/vc/diff-mode.el (diff--font-lock-prettify): Make regexp capture
file mode information.
---
 lisp/vc/diff-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 251d3dc090..7de427d4fd 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2665,7 +2665,7 @@ diff--font-lock-prettify
                             (concat " file with mode " (match-string 10) "  ")
                           " file  "))
               (modechanged (when (and (match-beginning 8) (match-beginning 9))
-                             (concat " mode changed from "
+                             (concat "mode changed from "
                                      (match-string 8) " to " (match-string 9)))))
           (add-text-properties
            (match-beginning 0) (1- (match-end 0))
-- 
2.30.2


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

Previous Next


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