From 382feaaa808946cde7fc3aa4fa20520e009fcaf3 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Fri, 15 Dec 2023 06:41:46 +0100 Subject: [PATCH 4/4] Fix register commands in kmacros When register-use-preview is nil we are exiting minibuffer with no confirmation after an idle delay. This cause a problem when executing kmacros because the commands in macro that should run outside the minibuffer run inside the minibuffer and BTW have no effect in current buffer. By using a preview fn that is not delayed we exit immediately with no delay and the commands are executed in the good order and in the main buffer. * lisp/register.el (register-read-with-preview): Use basic fn while executing kmacros. --- lisp/register.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/register.el b/lisp/register.el index 43dad90778c..15ed5c0a53b 100644 --- a/lisp/register.el +++ b/lisp/register.el @@ -429,7 +429,12 @@ Format of each entry is controlled by the variable `register-preview-function'." Prompt with the string PROMPT. If `help-char' (or a member of `help-event-list') is pressed, display such a window regardless." - (funcall register--read-with-preview-function prompt)) + (let ((register--read-with-preview-function + (if (and executing-kbd-macro + (memq register-use-preview '(nil never))) + #'register-read-with-preview-basic + (default-value 'register--read-with-preview-function)))) + (funcall register--read-with-preview-function prompt))) (defun register-read-with-preview-basic (prompt) "Read and return a register name, possibly showing existing registers. -- 2.34.1