[Top][All Lists]

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

Re: text_property_stickiness

From: Chong Yidong
Subject: Re: text_property_stickiness
Date: Sun, 25 Jun 2006 16:59:12 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

> This problem really is tricky, for the reasons I explained.
> It could be that we need to make sure find_field is never called
> for positions outside BEGV..ZV.  That may require changes in callers
> at higher level, and changes in the specs of the field functions.

I see.  I've checked the higher-level functions, and here are the

text_property_stickiness is called by:
  * get_pos_property, which is called by:
      ** find_field, which is called by:
      ** Fconstrain_to_field, which is called by:
      ** get_local_map, for only valid positions.
      ** adjust_point_for_property, for only valid positions.
  * adjust_for_invis_intang, which is called by:
      ** set_point_both, for only valid values of pos.

So the only thing we have to worry about are a bunch of lisp-visible
functions, Fdelete_field and so forth.  I think it is acceptable for
us to handle this situation by the signalling of an args_out_of_range
error, which, as you pointed out, already happens with the call to
Fget_text_property in text_property_stickiness.  So maybe all that we
need to do is to add a comment to the code.  (Or should we initialize
prev_pos to stop the checker from complaining?)

*** emacs/src/textprop.c.~1.147.~       2006-05-22 20:28:23.000000000 -0400
--- emacs/src/textprop.c        2006-06-25 16:50:17.000000000 -0400
*** 1789,1794 ****
--- 1789,1796 ----
    /* Consider following character.  */
+   /* If pos is outside the accessible range of the buffer, this
+      signals an args_out_of_range error.  */
    front_sticky = Fget_text_property (pos, Qfront_sticky, buffer);
    if (EQ (front_sticky, Qt)

reply via email to

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