aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2025-03-19 21:09:10 +0200
committerJuri Linkov2025-03-19 21:09:10 +0200
commit7016d1c8e3c16e8bfb61ce8ef96d85490a00c2eb (patch)
tree36c1486ca075fe426ac6aa38c4b4647f88009cc3
parenta77f10305c9ad0354987b09ec9a967021bb47d93 (diff)
downloademacs-7016d1c8e3c16e8bfb61ce8ef96d85490a00c2eb.tar.gz
emacs-7016d1c8e3c16e8bfb61ce8ef96d85490a00c2eb.zip
* lisp/files.el (save-some-buffers-action-alist): Fix 'view-mode'.
Use 'view-mode-enter' instead of 'view-buffer' to ignore the 'special' mode-class that prevents some modes from binding 'q' to 'exit-action' that should call 'exit-recursive-edit' (bug#76745).
-rw-r--r--lisp/files.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index f85021f0d69..461960d6f2b 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6288,7 +6288,10 @@ Before and after saving the buffer, this function runs
6288 (if (not enable-recursive-minibuffers) 6288 (if (not enable-recursive-minibuffers)
6289 (progn (display-buffer buf) 6289 (progn (display-buffer buf)
6290 (setq other-window-scroll-buffer buf)) 6290 (setq other-window-scroll-buffer buf))
6291 (view-buffer buf (lambda (_) (exit-recursive-edit))) 6291 ;; Like 'view-buffer' but ignore 'special' mode-class
6292 ;; because 'q' should call 'exit-action' in any case:
6293 (switch-to-buffer buf)
6294 (view-mode-enter nil (lambda (_) (exit-recursive-edit)))
6292 (recursive-edit)) 6295 (recursive-edit))
6293 ;; Return nil to ask about BUF again. 6296 ;; Return nil to ask about BUF again.
6294 nil) 6297 nil)
@@ -6307,7 +6310,10 @@ Before and after saving the buffer, this function runs
6307 (if (not enable-recursive-minibuffers) 6310 (if (not enable-recursive-minibuffers)
6308 (progn (display-buffer diffbuf) 6311 (progn (display-buffer diffbuf)
6309 (setq other-window-scroll-buffer diffbuf)) 6312 (setq other-window-scroll-buffer diffbuf))
6310 (view-buffer diffbuf (lambda (_) (exit-recursive-edit))) 6313 ;; Like 'view-buffer' but ignore 'special' mode-class
6314 ;; because 'q' should call 'exit-action' in any case:
6315 (switch-to-buffer diffbuf)
6316 (view-mode-enter nil (lambda (_) (exit-recursive-edit)))
6311 (recursive-edit)))) 6317 (recursive-edit))))
6312 ;; Return nil to ask about BUF again. 6318 ;; Return nil to ask about BUF again.
6313 nil) 6319 nil)