Article View: gnu.emacs.bug
Article #87413[19.27] creating text properties in strings
From: Erik Naggum
Date: Fri, 23 Sep 1994 04:51
Date: Fri, 23 Sep 1994 04:51
46 lines
2404 bytes
2404 bytes
In GNU Emacs 19.27.2 (sparc-sun-sunos4shr) of Sun Sep 18 1994 on naggum.no
when a string has no property list, and one is created (such as when `read'
is called to parse #("foobar" 0 5 (face bold)), `validate_interval_range'
will be called once with `soft' and then with `hard'. however, since
`validate_interval_range' increments its arguments if the object is a
string, it will increment them twice, leading to a incorrect treatment of
text properties in strings. this patch keeps the original values and calls
`validate_interval_string' with the same arguments with `soft' and `hard'.
I think this is a good idea even if object is a buffer.
#<Erik>
---------------------------------------------------------------------------
Fri Sep 23 04:44:38 1994 Erik Naggum <erik@naggum.no>
* textprop.c (Fset_text_properties): call validate_interval_range
with the original argument values when called again with `hard'.
*** src/textprop.c.~1~ Fri Sep 2 23:26:19 1994
--- src/textprop.c Fri Sep 23 04:35:18 1994
***************
*** 881,886 ****
--- 881,887 ----
register INTERVAL i, unchanged;
register INTERVAL prev_changed = NULL_INTERVAL;
register int s, len;
+ Lisp_Object orig_start = start, orig_end = end;
props = validate_plist (props);
***************
*** 894,899 ****
--- 895,905 ----
if (NILP (props))
return Qnil;
+ /* we're about to run validate_interval_range for the second time.
+ if object is a string, start and end will have been bumped up,
+ so undo that. */
+ start = orig_start;
+ end = orig_end;
i = validate_interval_range (object, &start, &end, hard);
/* This can return if start == end. */
if (NULL_INTERVAL_P (i))
Technical Details
Message-ID:
<19940923.5398@naggum.no>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!naggum.NO!erikShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,f89651d35ff5423,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-09-23 02:42:28 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!naggum.NO!erik From: erik@naggum.NO (Erik Naggum) Newsgroups: gnu.emacs.bug Subject: [19.27] creating text properties in strings Date: 23 Sep 1994 00:51:26 -0400 Organization: Naggum Software; +47 2295 0313 Lines: 46 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <19940923.5398@naggum.no>