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

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

bug#2179: 23.0.60; define-key vs define-key-after key syntax


From: Andreas Schwab
Subject: bug#2179: 23.0.60; define-key vs define-key-after key syntax
Date: Sun, 11 Sep 2011 23:48:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Gerard Brunick <gbrunick@math.utexas.edu> writes:
>
>> (define-key my-map [(control l)] 'do-something)
>>
>> works as expected, but
>>
>> (define-key-after my-map [(control l)] 'do-something)
>>
>> does not.  The reason is that define-key does a lot of work to allow
>> for a wide range of key syntaxes, but define-key-after just does:
>>
>> (setq key
>>      (if (<= (length key) 1) (aref key 0) ...
>>
>> and (control l) must get mapped to ?\C-l = 12 to be useful in a keymap.
>
> Yes, you'd expect both key's to allow the same syntax.  However, as far
> as I can see, all the magic to translate from the `define-key' key
> syntax is inside that C function, so that would have to be refactored
> out first.  I think.

Since define-key-after is only useful for menu-bar bindings which don't
use characters in keys this doesn't look like a serious restriction.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





reply via email to

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