From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs 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 Organization: JURTA Message-ID: <87mwo7juj6.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1377337757 28854 80.91.229.3 (24 Aug 2013 09:49:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Aug 2013 09:49:17 +0000 (UTC) Cc: 15126@debbugs.gnu.org To: Simon Katz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 24 11:49:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VDAT8-00035s-5g for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Aug 2013 11:49:18 +0200 Original-Received: from localhost ([::1]:40920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDAT7-0001Di-SY for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Aug 2013 05:49:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDASy-0001DP-Ks for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2013 05:49:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDASs-0006Eh-Mg for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2013 05:49:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDASs-0006Ed-KA for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2013 05:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VDASr-0005MA-Rw for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2013 05:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2013 09:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15126-submit@debbugs.gnu.org id=B15126.137733770720536 (code B ref 15126); Sat, 24 Aug 2013 09:49:01 +0000 Original-Received: (at 15126) by debbugs.gnu.org; 24 Aug 2013 09:48:27 +0000 Original-Received: from localhost ([127.0.0.1]:51841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDASJ-0005LA-9o for submit@debbugs.gnu.org; Sat, 24 Aug 2013 05:48:27 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:42591 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDASG-0005Ku-Kg for 15126@debbugs.gnu.org; Sat, 24 Aug 2013 05:48:25 -0400 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 685B4258B9E936; Sat, 24 Aug 2013 02:48:23 -0700 (PDT) In-Reply-To: (Simon Katz's message of "Sun, 18 Aug 2013 22:39:41 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77688 Archived-At: > 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,