diff options
| author | Eli Zaretskii | 2015-08-28 16:25:25 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-08-28 16:25:25 +0300 |
| commit | fdd095d2fd79f73ec96b9d318248e6ad70931b4a (patch) | |
| tree | 85431561e071e46577de43fa90f88262b23d416c | |
| parent | 572f68ea292e7207ceab8bfe5af365204bfcb9d2 (diff) | |
| download | emacs-fdd095d2fd79f73ec96b9d318248e6ad70931b4a.tar.gz emacs-fdd095d2fd79f73ec96b9d318248e6ad70931b4a.zip | |
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)
| -rw-r--r-- | lisp/subr.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 53dea3e2997..61b87065c8a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2277,7 +2277,18 @@ floating point support." | |||
| 2277 | t) | 2277 | t) |
| 2278 | ((input-pending-p t) | 2278 | ((input-pending-p t) |
| 2279 | nil) | 2279 | nil) |
| 2280 | ((<= seconds 0) | 2280 | ((or (<= seconds 0) |
| 2281 | ;; We are going to call read-event below, which will record | ||
| 2282 | ;; the the next key as part of the macro, even if that key | ||
| 2283 | ;; invokes kmacro-end-macro, so if we are recording a macro, | ||
| 2284 | ;; the macro will recursively call itself. In addition, when | ||
| 2285 | ;; that key is removed from unread-command-events, it will be | ||
| 2286 | ;; recorded the second time, so the macro will have each key | ||
| 2287 | ;; doubled. This used to happen if a macro was defined with | ||
| 2288 | ;; Flyspell mode active (because Flyspell calls sit-for in its | ||
| 2289 | ;; post-command-hook, see bug #21329.) To avoid all that, we | ||
| 2290 | ;; simply disable the wait when we are recording a macro. | ||
| 2291 | defining-kbd-macro) | ||
| 2281 | (or nodisp (redisplay))) | 2292 | (or nodisp (redisplay))) |
| 2282 | (t | 2293 | (t |
| 2283 | (or nodisp (redisplay)) | 2294 | (or nodisp (redisplay)) |