[Top][All Lists]

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

Re: local keymap patch for key-binding

From: David Kastrup
Subject: Re: local keymap patch for key-binding
Date: Mon, 11 Sep 2006 15:04:36 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Kim F. Storm) writes:

> David Kastrup <address@hidden> writes:
>> Ok, here I triggered a problem: I used C-h k (with the new help.el)
>> followed by a mouse-2 click on an overlay's 'before-string which has
>> its own 'keymap and 'display properties (the string, not the overlay).
>> I get
>> Debugger entered--Lisp error: (args-out-of-range 806 806)
>>   key-binding([(mouse-2 (#<window 41 on ang.tex> 806 ... -61397984 ... 806 
>> ... ... ... ...))] t)
>>   describe-key([(mouse-2 (#<window 41 on ang.tex> 806 ... -61397984 ... 806 
>> ... ... ... ...))] 1 nil)
>>   call-interactively(describe-key)
>> It would appear that 806 is the buffer position, and I would guess
>> that this is erroneously used as in index into the before-string
>> property of the overlay.
> I need a self-contained test-case to work on that.
> And I need to know the full contents of the failing event.

I found the problem already.  However, contrary to Chong Yidong's
assertion, a proper lookup dealing with keymap property, local-map
property (which Chong does not check at all), correct use of
overriding-local-map and overriding-terminal-local-map (which have to
be consulted before the keymaps of the mouse event, but based on the
buffer that the event happened in) is not as trivial as the current
code would suggest.

Also, the C-h k test masks some problems because it manually switches
to the buffer where the event occured before looking it up, so we
don't see the case where the event is not from the current

I am currently trying to implement this correctly, based on
(info "(elisp) Active Keymaps")
and the code for read-key-sequence.

I'll hopefully be through with this in a few hours.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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