From ff4623f0215803581f1d64295af943ad52172a6b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 8 Apr 2025 20:36:42 +0800 Subject: [PATCH] Fix window selection after log-edit-show-diff, again In October I installed a change to vc-diff-patch-string and labelled it as "Fix window selection after log-edit-show-diff" but that change only fixed the problem within log-view-modify-change-comment. This change should fix window selection after C-c C-d in ordinary checkins. * lisp/vc/log-edit.el (log-edit-diff-fileset): Use save-selected-window in order to respect the documented requirement that values of log-edit-diff-function leave the Log Edit buffer's window selected when they return. (cherry picked from commit d283db577339ee247826bfa1e8c1808dad823858) --- lisp/vc/log-edit.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 0da0b90975c..3c3288777c8 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -857,7 +857,8 @@ comment history, see `log-edit-comment-ring', and hides `log-edit-files-buf'." (defun log-edit-diff-fileset () "Display diffs for the files to be committed." (interactive) - (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset))) + (save-selected-window + (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset)))) (defun log-edit-show-diff () "Show the diff for the files to be committed." -- 2.39.5