]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix condition in register-read-with-preview-fancy
authorThierry Volpiatto <thievol@posteo.net>
Tue, 19 Dec 2023 16:45:22 +0000 (17:45 +0100)
committerThierry Volpiatto <thievol@posteo.net>
Wed, 20 Dec 2023 17:14:03 +0000 (18:14 +0100)
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

index 19b207960d6278628fcda56212b27a9e7b19a1a1..c2b10a91adb88c443a4ab171a44b686678f2a81b 100644 (file)
@@ -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)