emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive f71c199f4f 06/16: Fix: (hyperdrive--kill-buffer


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive f71c199f4f 06/16: Fix: (hyperdrive--kill-buffer-possibly-save) read-multiple-choice
Date: Thu, 28 Sep 2023 19:00:45 -0400 (EDT)

branch: elpa/hyperdrive
commit f71c199f4fe09394de034862b6224f9102a2a12e
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Fix: (hyperdrive--kill-buffer-possibly-save) read-multiple-choice
    
    When called on Emacs <28.
---
 hyperdrive.el | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/hyperdrive.el b/hyperdrive.el
index c8fd804077..d75cca88b4 100644
--- a/hyperdrive.el
+++ b/hyperdrive.el
@@ -728,17 +728,24 @@ The return value of this function is the retrieval 
buffer."
   (cl-assert (and hyperdrive-mode hyperdrive-current-entry))
   (let ((response
          (cadr
-          (read-multiple-choice
-           (format "Hyperdrive file %s modified; kill anyway?"
-                   (hyperdrive-entry-description hyperdrive-current-entry))
-           '((?y "yes" "kill buffer without saving")
-             (?n "no" "exit without doing anything")
-             (?s "save and then kill" "save the buffer and then kill it"))
-           nil nil (and (not (bound-and-true-p ;; Variable is new in Emacs 28.
-                              use-short-answers))
-                        (not (when (fboundp 'use-dialog-box-p)
-                               (with-no-warnings
-                                 (use-dialog-box-p)))))))))
+          (if (< emacs-major-version 28)
+              (read-multiple-choice
+               (format "Hyperdrive file %s modified; kill anyway?"
+                       (hyperdrive-entry-description hyperdrive-current-entry))
+               '((?y "yes" "kill buffer without saving")
+                 (?n "no" "exit without doing anything")
+                 (?s "save and then kill" "save the buffer and then kill it")))
+            (with-suppressed-warnings ((free-vars use-short-answers))
+              (compat-call read-multiple-choice
+                           (format "Hyperdrive file %s modified; kill anyway?"
+                                   (hyperdrive-entry-description 
hyperdrive-current-entry))
+                           '((?y "yes" "kill buffer without saving")
+                             (?n "no" "exit without doing anything")
+                             (?s "save and then kill" "save the buffer and 
then kill it"))
+                           nil nil (and (not use-short-answers)
+                                        (not (when (fboundp 'use-dialog-box-p)
+                                               (with-no-warnings
+                                                 (use-dialog-box-p)))))))))))
     (if (equal response "no")
         nil
       (unless (equal response "yes")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]