emacs-devel
[Top][All Lists]
Advanced

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

Re: Severe regressions in context of keyboard macros


From: Christoph Arenz
Subject: Re: Severe regressions in context of keyboard macros
Date: Sat, 28 Sep 2019 11:18:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 26.09.19 20:27, Christoph Arenz wrote:

Now, I started to get a closer look at the other facility you mentioned:
'(no-record . KEY):
Here is my current result. I did not have much time for tests, though.
Does this go in the right direction?
I spent some more time on this. The problem is bigger than stated in the
original bug report:
Any function key that follows a digit and is not separated by a <spc> or
<return> is recorded twice in calc when defining a keyboard macro, e.g.
`1 <return> <f3> 2 + <f4>' records "2++".

I am getting more confident that the patch below fixes this bug.Itfixes
a severe issue with macros in calc, does not make things worse and does
not interfere in case no macro is being defined.

Your thoughts?

Thanks,
Christoph

Author:     Christoph Arenz <address@hidden>
AuthorDate: Fri Sep 27 20:47:18 2019 +0200

Calc: prevent double-recording of keys in keyboard macros.

1 file changed, 5 insertions(+), 1 deletion(-)
lisp/calc/calc.el | 6 +++++-

modified   lisp/calc/calc.el
@@ -3400,7 +3400,11 @@ calc-read-key
     (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)))
+    ;; do not double-record key presses when 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))





reply via email to

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