Subject: bug#76745: 31.0.50; ?d action in save-some-buffers-action-alist to view diff does not work

From: Juri Linkov <[email-masked]>
Date: Wed, 05 Mar 2025 09:58:10 +0200

> Hello. I have found that the fix from #75993 breaks the ?d action in
> save-some-buffers-action-alist. The reason is that since we are not
> entering view-mode after #75993, when we type ?q to quit the diff
> window, we are not calling exit-recursive-edit to return to the
> save-some-buffers queries.
>
> So on one hand, we want to scroll through the diff easily to decide
> whether to save the buffer or not. But on the other hand, we want to
> navigate by the diff sections and copy hunks. To me, this is a model
> editing situation. The user should exit view mode to perform diff
> commands instead of disabling view-mode for diffs altogether like in
> #75993.
>
> But anyway, I propose that we revert #75993.

Reverting will again steal single-letter keys from diff-mode to view-mode.

Why not change only 'save-some-buffers-action-alist' and replace

  (view-buffer diffbuf (lambda (_) (exit-recursive-edit)))

with

  (with-current-buffer diffbuf (view-mode-enter nil (lambda (_) (exit-recursive-edit))))