From: Eli Zaretskii Date: Tue, 15 Oct 2019 12:09:55 +0000 (+0300) Subject: Fix recording keyboard macros in Calc X-Git-Tag: emacs-27.0.90~1053 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c76b968374e59b0d2c6f652b4f37555374f1ae7d;p=emacs.git Fix recording keyboard macros in Calc * lisp/calc/calc.el (calc-unread-command): Prevent recording key twice when defining a keyboard macro. Patch by Christoph Arenz . Copyright-paperwork-exempt: yes --- diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index ad483b406d5..3996c377b19 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -3400,7 +3400,12 @@ See Info node `(calc)Defining Functions'." (cons key key))) (defun calc-unread-command (&optional input) - (push (or input last-command-event) unread-command-events)) + (let ((event (or input last-command-event))) + ;; Avoid recording twice the keys pressed while defining a + ;; keyboard macro. + (when defining-kbd-macro + (setq event (cons 'no-record event))) + (push event unread-command-events))) (defun calc-clear-unread-commands () (setq unread-command-events nil))