all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Missing APIs for keymaps...
@ 2006-03-17 21:15 David Kastrup
  2006-03-20 17:40 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: David Kastrup @ 2006-03-17 21:15 UTC (permalink / raw)



Hi,

I was trying to figure out a good way to augment

mouse-on-link-p

in mouse.el to also work on images in overlays with a keymap and a
display property of an image.  Uh, tough.  We can presumably get the
image with posn-object.  But I don't see any way to get from there to
the keymap at that position.

Shouldn't we have something like posn-keymap for looking up the keymap
valid at some position?  What if there are several sparse keymaps in
succession (local keymap, overriding map, image map, hot spot map)?

Or maybe something like posn-key-binding which will do the lookup
through all relevant keymaps at posn?

At the current point of time it does not seem like one can get a
handle on this kind of functionality, even though Emacs has it
internally available somewhere.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Missing APIs for keymaps...
  2006-03-17 21:15 Missing APIs for keymaps David Kastrup
@ 2006-03-20 17:40 ` Stefan Monnier
  2006-03-20 17:59   ` David Kastrup
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2006-03-20 17:40 UTC (permalink / raw)
  Cc: emacs-devel

> in mouse.el to also work on images in overlays with a keymap and a
> display property of an image.  Uh, tough.  We can presumably get the
> image with posn-object.  But I don't see any way to get from there to
> the keymap at that position.

Can you use (get-char-property (posn-point posn) 'keymap) ?
Of course, if the keymap property is not on the buffer text but on
a before-string, that won't work :-(


        Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Missing APIs for keymaps...
  2006-03-20 17:40 ` Stefan Monnier
@ 2006-03-20 17:59   ` David Kastrup
  0 siblings, 0 replies; 3+ messages in thread
From: David Kastrup @ 2006-03-20 17:59 UTC (permalink / raw)
  Cc: emacs-devel

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

>> in mouse.el to also work on images in overlays with a keymap and a
>> display property of an image.  Uh, tough.  We can presumably get the
>> image with posn-object.  But I don't see any way to get from there to
>> the keymap at that position.
>
> Can you use (get-char-property (posn-point posn) 'keymap) ?
> Of course, if the keymap property is not on the buffer text but on
> a before-string, that won't work :-(

It is either on a before-string, or on a display property of an
overlay.  I'd like to give either a follow-link property and have
Emacs 22 work, and that would require some changes to mouse.el.  But I
don't see that those changes can be made with reasonable effort given
the current API.

Since the _functionality_ that is required is already available
internally, (keymap lookup at mouse click position), it would appear
that the sanest course of action would be exposing it, and then
changing mouse.el accordingly to heed follow-link.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-20 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-17 21:15 Missing APIs for keymaps David Kastrup
2006-03-20 17:40 ` Stefan Monnier
2006-03-20 17:59   ` David Kastrup

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.