GNU bug report logs -
#102
keymap property ignored for mouse click on overlay
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Sun, 30 Mar 2008 22:15:08 UTC
Severity: normal
Merged with 71
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
"Drew Adams" <drew.adams <at> oracle.com> writes:
>> The following patch implements the behavior you are looking for:
>> mouse clicks on before/after strings and display strings will use the
>> `keymap' overlay or text property associated with the text
>> position---unless the string itself defines a `keymap' text property,
>> in which case that keymap is used instead.
>>
>> Could you test it out? Please test as many combinations of
>> keymaps/overlays/textprops as possible. Test the output of
>> C-h k also.
>
> I can't build Emacs, sorry. If it were Lisp only, I would test it.
After studying this some more, I've decided to leave the current
behavior alone.
It turns out that the patch I posted earlier doesn't work for
after-strings, because the buffer position associated with an
after-string is the end of the overlay (1 + the postition of the last
character). As a result, there's no efficient way for read_key_sequence
to detect the existence of an overlay with a keymap for an after-string.
The fact that the buffer position of an after-string is the overlay end
isn't easily changed, because the redisplay engine relies on this for
efficiency (it means that the redisplay iterator can process all the
strings at a given charpos, before processing the buffer text).
Since the benefit of this feature is rather marginal in the first place,
I think it's better to simply document that display strings don't
inherit keymaps. The way to DTRT is to give the display string a
'keymap text property, which has always worked.
This bug report was last modified 17 years and 36 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.