[Top][All Lists]

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

Re: [patch] text property `point-entered': function called to often

From: Oliver Scholz
Subject: Re: [patch] text property `point-entered': function called to often
Date: Mon, 03 Mar 2003 15:04:06 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50

"Stefan Monnier" <monnier+gnu/emacs/address@hidden> writes:

>> But Emacs calls this function _each_ time point moves.
> Actually, it doesn't.  It calls it when point hits the text-property
> and a second time when point leaves the non-text-propertized area,
> but it doesn't call it when moving inside the text.
> I.e. it calls it once when reaching the edge of the propertized
> text and a second time when reaching the inside of it.

[My apologies, I have confused two different bugs in my report. In
fact it does call the function each time point moves in _my_ setup,
but this does not happen with emacs -q. I have not yet investigated
the cause. I will do, of course, but not at once.]

> The problem is that text-properties apply to chars while point
> is always between two chars.  This is why there is a fromprev
> and toprev which hold the proplist before the from position
> and before the to position (as opposed to from and to which hold
> the proplist after the from and to positions).

My understanding is that the relevant text properties should be the
ones "at", that is _after_ point. This is IMO consistent with the
usage of other special properties like `keymap'. 

> Have you taken a look at the various users of those properties
> to see whether your patch would have an impact (beneficial maybe)
> on their code ?

Only cursory yet, as I have to admit. In gomoku.el it doesn't matter,
in table.el the impact would be rather benefial as the according
function is less often called unnecessarily (no big deal OTOH). I
realize that the `point-entered' text property seems to be used in
sgml-mode.el, but I have not yet looked in what way.

> I think the cleanest behavior would be to rely on the stickiness
> of the point-left (or point-entered) property to determine when
> the call the function (either when reaching the edge or when
> reaching the inside of the text).

Is that really worth the trouble? _My_ mental modell at least is
that "point has moved inside a text area specified with a text
property" means the same as "the character after point now has the
text property in question". 

Oliver Scholz               13 Ventôse an 211 de la Révolution
Taunusstr. 25               Liberté, Egalité, Fraternité!
60329 Frankfurt a. M.       http://www.jungdemokratenhessen.de
Tel. (069) 97 40 99 42      http://www.jdjl.org

reply via email to

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