]> git.eshelyaron.com Git - emacs.git/commitdiff
Update the default value of 'diff-outline-regexp'.
authorJuri Linkov <juri@linkov.net>
Wed, 7 May 2025 06:31:01 +0000 (09:31 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 May 2025 08:53:34 +0000 (10:53 +0200)
* lisp/vc/diff-mode.el (diff-outline-regexp): Change the default value
to match the diff command name in recursive diff.  Move after
'diff-hunk-header-re' variable definition used in the new value.
(diff-setup-buffer-type): Change setq of 'diff-outline-regexp'
to buffer-local (bug#78269).

(cherry picked from commit 47b075e24b65b0c07ea3e887b9c6d46ba8fbaa78)

lisp/vc/diff-mode.el

index 194b0f5cb554e8d8191b74c5f7cabeef4c30947d..7070e71fc783cde1be49276c585cbcf1fd71fea2 100644 (file)
@@ -174,8 +174,6 @@ The default \"-b\" means to ignore whitespace-only changes,
 (defvar-local diff-default-directory nil
   "The default directory where the current Diff buffer was created.")
 
-(defvar diff-outline-regexp
-  "\\([*+][*+][*+] [^0-9]\\|@@ ...\\|\\*\\*\\* [0-9].\\|--- [0-9]..\\)")
 
 ;;;;
 ;;;; keymap, menu, ...
@@ -613,6 +611,9 @@ See https://lists.gnu.org/r/emacs-devel/2007-11/msg01990.html")
 
 (defconst diff-separator-re "^--+ ?$")
 
+(defvar diff-outline-regexp
+  (concat "\\(^diff.*\\|" diff-hunk-header-re "\\)"))
+
 (defvar diff-narrowed-to nil)
 
 (defun diff-hunk-style (&optional style)
@@ -1718,7 +1719,7 @@ modified lines of the diff."
                       'hg
                     nil))))
   (when (eq diff-buffer-type 'git)
-    (setq diff-outline-regexp
+    (setq-local diff-outline-regexp
           (concat "\\(^diff --git.*\\|" diff-hunk-header-re "\\)")))
   (setq-local outline-level #'diff--outline-level)
   (setq-local outline-regexp diff-outline-regexp))