From 1d0458c0352d11fafd3e7c219663381caf4057ac Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 27 Mar 2024 08:22:07 +0100 Subject: [PATCH] ; * lisp/simple.el (kill-buffer--possibly-save): Simplify. --- lisp/simple.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index f8ac9a549c0..60e881bbf88 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -11185,7 +11185,7 @@ If the buffer doesn't exist, create it first." If the user confirms, optionally save BUFFER that is about to be killed." (let ((response - (cadr + (car (read-multiple-choice (format "Buffer %s modified; kill anyway?" (buffer-name)) @@ -11194,9 +11194,8 @@ killed." (?s "save and then kill" "save the buffer and then kill it")) nil nil (and (not use-short-answers) (not (use-dialog-box-p))))))) - (if (equal response "no") - nil - (unless (equal response "yes") + (unless (= response ?n) + (when (= response ?s) (with-current-buffer buffer (save-buffer))) t))) -- 2.39.5