From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4894: 23.1; emacs ignores number characters in incremental search in keyboard macros Date: Wed, 11 Nov 2009 13:32:05 -0500 Message-ID: References: <87y6mdo6bi.fsf@mail.jurta.org> Reply-To: Stefan Monnier , 4894@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257966386 11749 80.91.229.12 (11 Nov 2009 19:06:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 19:06:26 +0000 (UTC) Cc: Petr Machata , 4894@emacsbugs.donarmstrong.com To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 11 20:06:19 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N8IW8-0004Gh-2H for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Nov 2009 20:06:08 +0100 Original-Received: from localhost ([127.0.0.1]:49864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8IW7-00026L-KD for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Nov 2009 14:06:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8IE3-00037C-Lu for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 13:47:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8IDy-00031v-NT for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 13:47:26 -0500 Original-Received: from [199.232.76.173] (port=45290 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8IDy-00031p-Bu for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 13:47:22 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55064) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N8IDx-00066t-CH for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2009 13:47:21 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nABIlI1v010615; Wed, 11 Nov 2009 10:47:19 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nABIe8Ac009717; Wed, 11 Nov 2009 10:40:08 -0800 Resent-Date: Wed, 11 Nov 2009 10:40:08 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 11 Nov 2009 18:40:08 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4894 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4894-submit@emacsbugs.donarmstrong.com id=B4894.12579643338855 (code B ref 4894); Wed, 11 Nov 2009 18:40:08 +0000 Original-Received: (at 4894) by emacsbugs.donarmstrong.com; 11 Nov 2009 18:32:13 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nABIWBNc008848 for <4894@emacsbugs.donarmstrong.com>; Wed, 11 Nov 2009 10:32:12 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAO+R+kpMCpsp/2dsb2JhbACBT9xGhDwEiSM X-IronPort-AV: E=Sophos;i="4.44,724,1249272000"; d="scan'208";a="49115268" Original-Received: from 76-10-155-41.dsl.teksavvy.com (HELO pastel.home) ([76.10.155.41]) by ironport2-out.pppoe.ca with ESMTP; 11 Nov 2009 13:32:05 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 5784E8373; Wed, 11 Nov 2009 13:32:05 -0500 (EST) In-Reply-To: <87y6mdo6bi.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 11 Nov 2009 12:42:57 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 11 Nov 2009 13:47:26 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32547 Archived-At: >> Do the following to record a macro involving an incremental search >> looking for a string "x00x": >> >> M-x kmacro-start-macro C-s x 0 0 x M-x kmacro-end-macro >> >> Observe that the macro doesn't include the 0 characters at all: > Do you type these zeroes with a numpad? I can reproduce this bug when > zeroes are typed with , so the last macro doesn't contain zeroes. > The reason is an intentional call to `cancel-kbd-macro-events' in the > first branch of `cond' in `isearch-other-meta-char'. I don't know why > this is needed. CVS logs show that this line was added at 1995-08-10. Actually, the need for cancel-kbd-macro-events is explained in the comment. The problem is that after cancelling the we should add the ?0 replacement. That should normally be done by isearch-unread, but for printing char, we don't call that function any more. I.e. the problem was introduced by the change below. Handa, can you explain why we need this? Maybe it was needed at the time but not any more? Stefan committer: handa branch nick: HEAD timestamp: Thu 2000-06-01 12:22:31 +0000 message: (isearch-update): Set disable-point-adjustment to t to prevent the point moving to the end of a composition when a part of a composition is searched. (isearch-other-meta-char): If the key invoking this command can be mapped by function-key-map to a printing char, call isearch-process-search-char directly. ------------------------------------------------------------ === modified file 'lisp/isearch.el' --- lisp/isearch.el 2000-05-31 09:49:22 +0000 +++ lisp/isearch.el 2000-06-01 12:22:31 +0000 @@ -619,7 +619,10 @@ (setq ;; quit-flag nil not for isearch-mode isearch-adjusted nil isearch-yank-flag nil) - (isearch-lazy-highlight-new-loop)) + (isearch-lazy-highlight-new-loop) + ;; We must prevent the point moving to the end of composition when a + ;; part of the composition has just been searched. + (setq disable-point-adjustment t)) (defun isearch-done (&optional nopush edit) (remove-hook 'mouse-leave-buffer-hook 'isearch-done) @@ -1150,8 +1153,22 @@ (progn (isearch-done) (apply 'isearch-unread keylist)) - (apply 'isearch-unread - (listify-key-sequence (lookup-key function-key-map key))))) + (setq keylist + (listify-key-sequence (lookup-key function-key-map key))) + (while keylist + (setq key (car keylist)) + ;; If KEY is a printing char, we handle it here + ;; directly to avoid the input method and keyboard + ;; coding system translating it. + (if (and (integerp key) + (>= key ?\ ) (< key 256)) + (progn + (isearch-process-search-char key) + (setq keylist (cdr keylist))) + ;; As the remaining keys in KEYLIST can't be handled + ;; here, we must reread them. + (apply 'isearch-unread keylist) + (setq keylist nil))))) ( ;; Handle an undefined shifted control character ;; by downshifting it if that makes it defined.