Subject: Re: bug#4894: 23.1; emacs ignores number characters in incremental search in keyboard macros

From: Juri Linkov <[email-masked]>
Date: Wed, 11 Nov 2009 12:42:57 +0200

> 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:
>
>  M-x kmacro-view-macro
>
> On my machine, the above shows:
>
>  Last macro: C-s xx M-x kmacro-en TAB ma TAB [2 times]
>
> (i.e. the macro system seems to ignore the zeroes, and take more
> keystrokes from the queue or whatever the underlying implementation
> is.)

Do you type these zeroes with a numpad?  I can reproduce this bug when
zeroes are typed with <kp-0>, 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.

Also I noticed a related bug: when zeroes are typed with <S-kp-0> then
<S-kp-0> terminates Isearch instead of adding zeroes to the search string.
That's because <S-kp-0> is processed in the 6-th branch of `cond'
in `isearch-other-meta-char' (with `search-exit-option') where
unprocessed control characters terminate Isearch.

-- 
Juri Linkov
http://www.jurta.org/emacs/