emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master fdd095d: Fix a bug in recording a macro while flysp


From: Eli Zaretskii
Subject: [Emacs-diffs] master fdd095d: Fix a bug in recording a macro while flyspell-mode is active
Date: Fri, 28 Aug 2015 13:26:37 +0000

branch: master
commit fdd095d2fd79f73ec96b9d318248e6ad70931b4a
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix a bug in recording a macro while flyspell-mode is active
    
    * lisp/subr.el (sit-for): Don't call read-event when recording a
    macro.  (Bug#21329)
---
 lisp/subr.el |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 53dea3e..61b8706 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2277,7 +2277,18 @@ floating point support."
     t)
    ((input-pending-p t)
     nil)
-   ((<= seconds 0)
+   ((or (<= seconds 0)
+        ;; We are going to call read-event below, which will record
+        ;; the the next key as part of the macro, even if that key
+        ;; invokes kmacro-end-macro, so if we are recording a macro,
+        ;; the macro will recursively call itself.  In addition, when
+        ;; that key is removed from unread-command-events, it will be
+        ;; recorded the second time, so the macro will have each key
+        ;; doubled.  This used to happen if a macro was defined with
+        ;; Flyspell mode active (because Flyspell calls sit-for in its
+        ;; post-command-hook, see bug #21329.)  To avoid all that, we
+        ;; simply disable the wait when we are recording a macro.
+        defining-kbd-macro)
     (or nodisp (redisplay)))
    (t
     (or nodisp (redisplay))



reply via email to

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