GNU bug report logs - #15126
24.3; kmacro-end-and-call-macro repeats macro multiple times following isearch-forward

Previous Next

Package: emacs;

Reported by: Simon Katz <nomiskatz <at> gmail.com>

Date: Sun, 18 Aug 2013 22:33:01 UTC

Severity: normal

Found in version 24.3

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Simon Katz <nomiskatz <at> gmail.com>
Cc: 15126 <at> debbugs.gnu.org
Subject: bug#15126: 24.3; kmacro-end-and-call-macro repeats macro multiple times following isearch-forward
Date: Sat, 24 Aug 2013 12:45:01 +0300
> In Emacs 24.2.1 and all previous versions I've used,
> kmacro-end-and-call-macro calls the macro once more, and I can go
> through the file making changes one at a time, and I can stop when I
> want.
>
> In Emacs 24.3.1, kmacro-end-and-call-macro calls the macro repeatedly
> making changes to all the repeated text up to the end of the file.

Actually this is an old bug uncovered by another unrelated change.
Emacs 24.2.1 stored the key `C-x' in the keyboard macro.
Emacs 24.3.1 now stores the whole key sequence `C-x e'.

Storing `C-x' had no effect, but also made no sense.
It's clear that neither `C-x' nor `C-x e' should be stored.
So not storing `C-x e' will not execute the same macro repeatedly.

Currently I see only one way to fix this properly:

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-08-08 23:59:14 +0000
+++ lisp/isearch.el	2013-08-24 09:27:30 +0000
@@ -2386,6 +2386,13 @@ (defun isearch-other-meta-char (&optiona
              (isearch-unread-key-sequence keylist)
              (setq main-event (car unread-command-events))
 
+	     ;; Don't store special commands in the keyboard macro.
+	     (let (overriding-terminal-local-map)
+	       (when (memq (key-binding key)
+			   '(kmacro-start-macro
+			     kmacro-end-macro kmacro-end-and-call-macro))
+		 (cancel-kbd-macro-events)))
+
 	     ;; If we got a mouse click event, that event contains the
 	     ;; window clicked on. maybe it was read with the buffer
 	     ;; it was clicked on.  If so, that buffer, not the current one,





This bug report was last modified 11 years and 269 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.