unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Severe regressions in context of keyboard macros
@ 2019-09-19  8:17 Christoph Arenz
  2019-09-20  7:23 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Christoph Arenz @ 2019-09-19  8:17 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2244 bytes --]

I think I have found two regressions that were introduced some time ago
by commit 30a6b1f81412044a, affecting keyboard macros. One is severely
affecting calc to the point of leading to completely wrong results -- if
not stopped by an error first. The other is affecting how dribble writes
out recorded keys.

Calc:
I stumbled across the following bug using calc -- see also
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37057:
90 <RET> S <f3> I S <f4>
This calculates the sine and inverse sine of 90 -- with a result of 90.
It also records "IS" as a keyboard macro.
Now, let's use the macro to complete the same calculation:
90 <RET> S <f4>
This worked until emacs-24.5 but is broken since emacs-25.1 where "ISS"
is recorded as a keyboard macro -- now leading to a result of 1.

It seems all macros that involve calc's prefix keys (e.g. "I" or "H")
have the following key recorded twice in last-kbd-macro. E.g. "IHP" is
recorded as "IHHPP", pushing GAMMA and PI on the stack instead of one
constant, namely PHI.

Hopefully, the calculation breaks due to an error -- otherwise, you get
nonsense results which might be hard to debug, if noticed at all.


Dribble:
According to the documentation in open-dribble-file, this starts
'writing all keyboard characters to a dribble file'.
However, the keys being recorded changed with commit 30a6b1f81412044a
when a keyboard macro is involved.

Prior, the key "<f4>" was recorded when a macro was replayed. With the
patch, the recording contains "<f4>" and additionally all characters
that were replayed by the macro. This gets ugly quickly, e.g. when <f3>
was used in the macro to insert a counter.


I am not suggesting that reverting commit 30a6b1f81412044a is the final
and right solution, but it does resolve the two issues in calc and
dribble in emacs-26.3. I stumbled across the mail thread
https://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00193.html
where there were some doubts whether the quick fix could break something
else.

Keyboard.c seems highly complex and magic to me. I first thought that
sit-for in subr.el might have something to do with it as it has fixme
comments mentioning unread-command-events. Just a wild guess...



[-- Attachment #2: Type: text/html, Size: 3101 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-10-15 12:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-19  8:17 Severe regressions in context of keyboard macros Christoph Arenz
2019-09-20  7:23 ` Eli Zaretskii
2019-09-20 15:43   ` Christoph Arenz
2019-09-20 17:54     ` Eli Zaretskii
2019-09-23 11:57       ` Christoph Arenz
2019-09-24  8:45         ` Eli Zaretskii
2019-09-26 10:46           ` Christoph Arenz
2019-09-26 10:56             ` Eli Zaretskii
2019-09-26 11:22               ` Christoph Arenz
2019-09-26 12:10                 ` Eli Zaretskii
2019-09-26 18:27                   ` Christoph Arenz
2019-09-28  9:18                     ` Christoph Arenz
2019-09-28  9:46                       ` Eli Zaretskii
2019-09-29 17:42                         ` Christoph Arenz
2019-10-15 12:12                           ` Eli Zaretskii
2019-09-28 12:35                       ` Stefan Monnier
2019-09-28 13:44                         ` Eli Zaretskii
2019-09-29 17:59                           ` Christoph Arenz
2019-09-27 14:58             ` Fwd: " Christoph Arenz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).