]> git.eshelyaron.com Git - emacs.git/commitdiff
; * lisp/simple.el (kill-buffer--possibly-save): Simplify.
authorEshel Yaron <me@eshelyaron.com>
Wed, 27 Mar 2024 07:22:07 +0000 (08:22 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 27 Mar 2024 20:38:44 +0000 (21:38 +0100)
lisp/simple.el

index f8ac9a549c094b02f246e9e092ec5b3f6dba48f9..60e881bbf888535f7805e00ad8d4d6e8a8f0c4a7 100644 (file)
@@ -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)))