From 777c6c7e821d44faa970655c04e9eba8e5b11498 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Tue, 19 Dec 2023 17:45:22 +0100 Subject: [PATCH 4/4] 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) -- 2.34.1