emacs-devel
[Top][All Lists]
Advanced

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

Re: Missing display object API...


From: David Kastrup
Subject: Re: Missing display object API...
Date: Tue, 29 Aug 2006 11:38:56 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

David Kastrup <address@hidden> writes:

> However, it turns out that we can't get back to the overlay from
> `posn-object': it merely returns the string or image used as display,
> before-string or after-string property of the overlay.
>
> Maybe one should have something like `posn-object-overlay' returning
> #<some overlay>
> for a click from an overlay, and something like
> `posn-object-type'
> returning 'after-string, 'before-string or 'display
> for a click on an overlay or text property inherited stuff?
>
> The rest of the coordinates for a text property can be gotten with
> (window-buffer (posn-buffer ...)) and (posn-point ...) when
> necessary.

Correction: I meant (window-buffer (posn-window ...)), and it will not
work if the window configuration has changed since the click
registered.  So probably instead of posn-object-overlay, one would
want posn-object-parent which returns either a buffer (when the origin
was from a text property) or an overlay (when the origin was from an
overlay).

Since a change of window configuration will also affect clicks into
the text area, maybe a separate posn-buffer would be useful in the
event structure?

> But for an overlay, most bets are off, unless we want to cycle
> overlays-at searching for the origin.  And this will not work
> reliably if there are several overlays using the same string or
> image, or of the buffer changed since the click.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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