From 852ca2ff40e6488ea807f02b9ad1f939555dd943 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 10 Jan 2026 11:57:09 +0000 Subject: [PATCH] Disable diff-restrict-view by default * lisp/vc/diff-mode.el (diff-restrict-view): Disable it. * etc/NEWS: Announce the change. --- etc/NEWS | 7 +++++++ lisp/vc/diff-mode.el | 1 + 2 files changed, 8 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index b3b9a84680e..d21cf659bfb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2825,6 +2825,13 @@ already have, consider replacing the default global bindings, like this: --- *** New command alias 'vc-restore' for 'vc-revert'. +--- +*** The 'diff-restrict-view' command is disabled by default. +This command is Diff mode's specialized 'narrow-to-region'. +'narrow-to-region' has long been disabled by default, so for +consistency, 'diff-restrict-view' is now too. +To enable it again, use 'M-x enable-command'. + ** Package +++ diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index dcba8c44792..5286a079b4c 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -875,6 +875,7 @@ If the prefix ARG is given, restrict the view to the current file instead." (apply #'narrow-to-region (if arg (diff-bounds-of-file) (diff-bounds-of-hunk))) (setq-local diff-narrowed-to (if arg 'file 'hunk))) +(put 'diff-restrict-view 'disabled t) (defun diff--some-hunks-p () (save-excursion