emacs-diffs
[Top][All Lists]
Advanced

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

master b499d4f65a7 4/5: Fix condition in register-read-with-preview-fanc


From: Thierry Volpiatto
Subject: master b499d4f65a7 4/5: Fix condition in register-read-with-preview-fancy
Date: Wed, 20 Dec 2023 12:15:09 -0500 (EST)

branch: master
commit b499d4f65a7c1ce45500dcbf1c5c63d85241b330
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix condition in register-read-with-preview-fancy
    
    Now with have :noconfirm no need to check for '(set modify) otherwise
    we fail as well in kmacros when register-use-preview is t.
    The conditions should not be hard coded in
    register-read-with-preview-fancy but in the cl-defmethod
    register-command-info for each command.
    
    * lisp/register.el (register-read-with-preview-fancy): Remove now
    unneeded condition.
---
 lisp/register.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/register.el b/lisp/register.el
index 19b207960d6..c2b10a91adb 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -207,14 +207,16 @@ SMATCH accept a boolean value to say if command accept 
non matching register."
    :types '(string number)
    :msg "Insert register `%s'"
    :act 'insert
-   :smatch t))
+   :smatch t
+   :noconfirm (memq register-use-preview '(nil never))))
 (cl-defmethod register-command-info ((_command (eql jump-to-register)))
   (make-register-preview-info
    :types  '(window frame marker kmacro
              file buffer file-query)
    :msg "Jump to register `%s'"
    :act 'jump
-   :smatch t))
+   :smatch t
+   :noconfirm (memq register-use-preview '(nil never))))
 (cl-defmethod register-command-info ((_command (eql view-register)))
   (make-register-preview-info
    :types '(all)
@@ -555,12 +557,10 @@ display such a window regardless."
                                (unless (string= pat "")
                                  (with-selected-window (minibuffer-window)
                                    (if (and (member pat strs)
-                                            (memq act '(set modify))
                                             (null noconfirm))
                                        (with-selected-window 
(minibuffer-window)
                                          (minibuffer-message msg pat))
-                                     ;; The action is insert or
-                                     ;; jump or noconfirm is specifed
+                                     ;; :noconfirm is specifed
                                      ;; explicitely, don't ask for
                                      ;; confirmation and exit immediately 
(bug#66394).
                                      (setq result pat)



reply via email to

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