Subject: bug#54034: 29.0.50; Diff prettify broken for empty files

From: Matthias Meulien <[email-masked]>
Date: Thu, 07 Apr 2022 00:51:37 +0200

Hi Stefan,

Stefan Monnier <[email-masked]> 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:

>From 09d1fa92b73ce956e75608f1a8a4c9fee8e7ca70 Mon Sep 17 00:00:00 2001
From: Matthias Meulien <[email-masked]>
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