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, 19 Mar 2025 21:09:24 +0200

close 76745 31.0.50
thanks

> Well, let's do this then. Patch something in so that save-some-buffers
> "d" key lets us do "q" to exit the diff buffer. I still disagree because
> view-mode is supported by Evil etc but if we do like a local-set-key or
> something, it will probably break other packages that don't handle this
> very special case of save-some-buffers.

After more analysis I found that this problem is not specific to diff-mode.
For example, hexl-mode also has

  (put 'hexl-mode 'mode-class 'special)

Then in a file with 'hexl-mode' after typing 'C-x s C-r q' nothing happens,
no exit from recursive-edit.  Because 'C-r' in 'save-some-buffers-action-alist'
relies on the same unreliable trick:

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

So now both cases are fixed in 'save-some-buffers-action-alist'.