bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5481: 23.1; insert-kbd-macro: does not write key-binding code


From: Chong Yidong
Subject: bug#5481: 23.1; insert-kbd-macro: does not write key-binding code
Date: Wed, 03 Mar 2010 15:45:33 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I see the problem.  On further examination, there was already code in
>> macro.el that was supposed to handle this, but it was broken.  I've
>> checked in a fix.  Thanks for the bug report, and for the follow-up.
> [...]
>>   * src/keymap.c (Fwhere_is_internal): Use Fequal to compare
>>   definitions, so that keyboard macros are correctly handled
>>   (Bug#5481).
>
> Could you explain why Fequal is necessary there?  It should only make
> a difference if we're comparing one macro (ie. vector) against another
> identical macro, but IIUC that shouldn't be the case here.

We are indeed comparing one macro against another macro.  For a macro
bound to a key, (key-binding KEY-BOUND-TO-A-MACRO) returns the lambda
form of the macro.  The function where_is_internal_1 uses Fequal
(keymap.c:3001), and it locates the correct binding if you give the
lambda form as the `definition' argument.

But the binding found by where_is_internal was tossed aside in
Fwhere_is_internal because the result of shadow_lookup was compared
using EQ---clearly an incorrect step.  That's the part I changed.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]