emacs-pretest-bug
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: Re: [patch] text property `point-entered': function called to often
Date: Mon, 10 Mar 2003 13:44:40 -0500

> > 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'.

As RMS showed, the curent behavior is the documented one.
So at least we're not seeing a bug, but maybe a bad choice instead.

> > 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.

sgml-mode only uses it to unhide tags when the cursor passes by them
(if you use the corresponding minor mode that hides the tags).  It
shouldn't be affected significantly.

> > 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?

Who said it's a lot of 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".

I tend to think of text areas as similar to `fields' and the
behavior of fields depend crucially on stickiness.

On a different but related note, I think many uses of
point-entered/point-left would be better served by some new
cursor-entered/cursor-left properties (i.e. called after
each post-command-hook rather than after each goto-char).


        Stefan





reply via email to

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