annotate src/textprop.c @ 1164:adfaeccad01d

entered into RCS
author Joseph Arceneaux <jla@gnu.org>
date Sat, 19 Sep 1992 01:11:21 +0000
parents 7eb43ab890e0
children 9f50cccf5963
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1029
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
1 /* Interface code for dealing with text properties.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
2 Copyright (C) 1992 Free Software Foundation, Inc.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
3
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
4 This file is part of GNU Emacs.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
5
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
8 the Free Software Foundation; either version 1, or (at your option)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
9 any later version.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
10
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
14 GNU General Public License for more details.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
15
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
19
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
20 #include "config.h"
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
21 #include "lisp.h"
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
22 #include "intervals.h"
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
23 #include "buffer.h"
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
24
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
25
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
26 /* NOTES: previous- and next- property change will have to skip
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
27 zero-length intervals if they are implemented. This could be done
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
28 inside next_interval and previous_interval.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
29
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
30 It is assumed that for any interval plist, a property appears
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
31 only once on the list. Although some code i.e., remove_properties (),
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
32 handles the more general case, the uniqueness of properties is
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
33 neccessary for the system to remain consistent. This requirement
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
34 is enforced by the subrs installing properties onto the intervals. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
35
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
36
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
37 /* Types of hooks. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
38 Lisp_Object Qmouse_left;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
39 Lisp_Object Qmouse_entered;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
40 Lisp_Object Qpoint_left;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
41 Lisp_Object Qpoint_entered;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
42 Lisp_Object Qmodification;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
43
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
44 /* Visual properties text (including strings) may have. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
45 Lisp_Object Qforeground, Qbackground, Qfont, Qunderline, Qstipple;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
46 Lisp_Object Qinvisible, Qread_only;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
47
1055
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
48 /* Extract the interval at the position pointed to by BEGIN from
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
49 OBJECT, a string or buffer. Additionally, check that the positions
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
50 pointed to by BEGIN and END are within the bounds of OBJECT, and
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
51 reverse them if *BEGIN is greater than *END. The objects pointed
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
52 to by BEGIN and END may be integers or markers; if the latter, they
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
53 are coerced to integers.
1029
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
54
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
55 Note that buffer points don't correspond to interval indices.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
56 For example, point-max is 1 greater than the index of the last
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
57 character. This difference is handled in the caller, which uses
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
58 the validated points to determine a length, and operates on that.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
59 Exceptions are Ftext_properties_at, Fnext_property_change, and
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
60 Fprevious_property_change which call this function with BEGIN == END.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
61 Handle this case specially.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
62
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
63 If FORCE is soft (0), it's OK to return NULL_INTERVAL. Otherwise,
1055
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
64 create an interval tree for OBJECT if one doesn't exist, provided
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
65 the object actually contains text. In the current design, if there
7eb43ab890e0 entered into RCS
Joseph Arceneaux <jla@gnu.org>
parents: 1029
diff changeset
66 is no text, there can be no text properties. */
1029
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
67
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
68 #define soft 0
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
69 #define hard 1
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
70
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
71 static INTERVAL
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
72 validate_interval_range (object, begin, end, force)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
73 Lisp_Object object, *begin, *end;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
74 int force;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
75 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
76 register INTERVAL i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
77 CHECK_STRING_OR_BUFFER (object, 0);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
78 CHECK_NUMBER_COERCE_MARKER (*begin, 0);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
79 CHECK_NUMBER_COERCE_MARKER (*end, 0);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
80
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
81 /* If we are asked for a point, but from a subr which operates
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
82 on a range, then return nothing. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
83 if (*begin == *end && begin != end)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
84 return NULL_INTERVAL;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
85
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
86 if (XINT (*begin) > XINT (*end))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
87 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
88 register int n;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
89 n = XFASTINT (*begin); /* This is legit even if *begin is < 0 */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
90 *begin = *end;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
91 XFASTINT (*end) = n; /* because this is all we do with n. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
92 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
93
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
94 if (XTYPE (object) == Lisp_Buffer)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
95 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
96 register struct buffer *b = XBUFFER (object);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
97
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
98 /* If there's no text, there are no properties. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
99 if (BUF_BEGV (b) == BUF_ZV (b))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
100 return NULL_INTERVAL;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
101
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
102 if (!(BUF_BEGV (b) <= XINT (*begin) && XINT (*begin) <= XINT (*end)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
103 && XINT (*end) <= BUF_ZV (b)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
104 args_out_of_range (*begin, *end);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
105 i = b->intervals;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
106
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
107 /* Special case for point-max: return the interval for the
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
108 last character. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
109 if (*begin == *end && *begin == BUF_Z (b))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
110 *begin -= 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
111 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
112 else
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
113 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
114 register struct Lisp_String *s = XSTRING (object);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
115
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
116 if (! (1 <= XINT (*begin) && XINT (*begin) <= XINT (*end)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
117 && XINT (*end) <= s->size))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
118 args_out_of_range (*begin, *end);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
119 i = s->intervals;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
120 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
121
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
122 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
123 return (force ? create_root_interval (object) : i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
124
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
125 return find_interval (i, XINT (*begin));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
126 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
127
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
128 /* Validate LIST as a property list. If LIST is not a list, then
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
129 make one consisting of (LIST nil). Otherwise, verify that LIST
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
130 is even numbered and thus suitable as a plist. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
131
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
132 static Lisp_Object
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
133 validate_plist (list)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
134 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
135 if (NILP (list))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
136 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
137
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
138 if (CONSP (list))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
139 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
140 register int i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
141 register Lisp_Object tail;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
142 for (i = 0, tail = list; !NILP (tail); i++)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
143 tail = Fcdr (tail);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
144 if (i & 1)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
145 error ("Odd length text property list");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
146 return list;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
147 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
148
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
149 return Fcons (list, Fcons (Qnil, Qnil));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
150 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
151
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
152 #define set_properties(list,i) (i->plist = Fcopy_sequence (list))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
153
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
154 /* Return nonzero if interval I has all the properties,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
155 with the same values, of list PLIST. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
156
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
157 static int
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
158 interval_has_all_properties (plist, i)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
159 Lisp_Object plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
160 INTERVAL i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
161 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
162 register Lisp_Object tail1, tail2, sym1, sym2;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
163 register int found;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
164
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
165 /* Go through each element of PLIST. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
166 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
167 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
168 sym1 = Fcar (tail1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
169 found = 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
170
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
171 /* Go through I's plist, looking for sym1 */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
172 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
173 if (EQ (sym1, Fcar (tail2)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
174 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
175 /* Found the same property on both lists. If the
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
176 values are unequal, return zero. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
177 if (! EQ (Fequal (Fcar (Fcdr (tail1)), Fcar (Fcdr (tail2))),
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
178 Qt))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
179 return 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
180
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
181 /* Property has same value on both lists; go to next one. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
182 found = 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
183 break;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
184 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
185
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
186 if (! found)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
187 return 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
188 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
189
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
190 return 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
191 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
192
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
193 /* Return nonzero if the plist of interval I has any of the
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
194 properties of PLIST, regardless of their values. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
195
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
196 static INLINE int
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
197 interval_has_some_properties (plist, i)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
198 Lisp_Object plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
199 INTERVAL i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
200 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
201 register Lisp_Object tail1, tail2, sym;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
202
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
203 /* Go through each element of PLIST. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
204 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
205 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
206 sym = Fcar (tail1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
207
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
208 /* Go through i's plist, looking for tail1 */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
209 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
210 if (EQ (sym, Fcar (tail2)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
211 return 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
212 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
213
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
214 return 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
215 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
216
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
217 /* Add the properties of PLIST to the interval I, or set
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
218 the value of I's property to the value of the property on PLIST
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
219 if they are different.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
220
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
221 Return nonzero if this changes I (i.e., if any members of PLIST
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
222 are actually added to I's plist) */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
223
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
224 static INLINE int
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
225 add_properties (plist, i)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
226 Lisp_Object plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
227 INTERVAL i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
228 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
229 register Lisp_Object tail1, tail2, sym1, val1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
230 register int changed = 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
231 register int found;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
232
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
233 /* Go through each element of PLIST. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
234 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
235 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
236 sym1 = Fcar (tail1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
237 val1 = Fcar (Fcdr (tail1));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
238 found = 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
239
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
240 /* Go through I's plist, looking for sym1 */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
241 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
242 if (EQ (sym1, Fcar (tail2)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
243 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
244 register Lisp_Object this_cdr = Fcdr (tail2);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
245
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
246 /* Found the property. Now check its value. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
247 found = 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
248
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
249 /* The properties have the same value on both lists.
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
250 Continue to the next property. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
251 if (Fequal (val1, Fcar (this_cdr)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
252 break;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
253
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
254 /* I's property has a different value -- change it */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
255 Fsetcar (this_cdr, val1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
256 changed++;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
257 break;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
258 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
259
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
260 if (! found)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
261 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
262 i->plist = Fcons (sym1, Fcons (val1, i->plist));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
263 changed++;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
264 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
265 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
266
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
267 return changed;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
268 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
269
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
270 /* For any members of PLIST which are properties of I, remove them
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
271 from I's plist. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
272
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
273 static INLINE int
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
274 remove_properties (plist, i)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
275 Lisp_Object plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
276 INTERVAL i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
277 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
278 register Lisp_Object tail1, tail2, sym;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
279 register Lisp_Object current_plist = i->plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
280 register int changed = 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
281
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
282 /* Go through each element of plist. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
283 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
284 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
285 sym = Fcar (tail1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
286
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
287 /* First, remove the symbol if its at the head of the list */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
288 while (! NILP (current_plist) && EQ (sym, Fcar (current_plist)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
289 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
290 current_plist = Fcdr (Fcdr (current_plist));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
291 changed++;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
292 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
293
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
294 /* Go through i's plist, looking for sym */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
295 tail2 = current_plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
296 while (! NILP (tail2))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
297 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
298 register Lisp_Object this = Fcdr (Fcdr (tail2));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
299 if (EQ (sym, Fcar (this)))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
300 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
301 Fsetcdr (Fcdr (tail2), Fcdr (Fcdr (this)));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
302 changed++;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
303 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
304 tail2 = this;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
305 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
306 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
307
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
308 if (changed)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
309 i->plist = current_plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
310 return changed;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
311 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
312
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
313 /* Remove all properties from interval I. Return non-zero
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
314 if this changes the interval. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
315
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
316 static INLINE int
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
317 erase_properties (i)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
318 INTERVAL i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
319 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
320 if (NILP (i->plist))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
321 return 0;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
322
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
323 i->plist = Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
324 return 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
325 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
326
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
327
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
328 DEFUN ("text-properties-at", Ftext_properties_at,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
329 Stext_properties_at, 1, 2, 0,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
330 "Return the list of properties held by the character at POSITION\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
331 in optional argument OBJECT, a string or buffer. If nil, OBJECT\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
332 defaults to the current buffer.")
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
333 (pos, object)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
334 Lisp_Object pos, object;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
335 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
336 register INTERVAL i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
337 register int p;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
338
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
339 if (NILP (object))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
340 XSET (object, Lisp_Buffer, current_buffer);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
341
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
342 i = validate_interval_range (object, &pos, &pos, soft);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
343 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
344 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
345
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
346 return i->plist;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
347 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
348
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
349 DEFUN ("next-property-change", Fnext_property_change,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
350 Snext_property_change, 2, 2, 0,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
351 "Return the position after POSITION in OBJECT which has properties\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
352 different from those at POSITION. OBJECT may be a string or buffer.\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
353 Returns nil if unsuccessful.")
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
354 (pos, object)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
355 Lisp_Object pos, object;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
356 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
357 register INTERVAL i, next;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
358
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
359 i = validate_interval_range (object, &pos, &pos, soft);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
360 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
361 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
362
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
363 next = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
364 while (! NULL_INTERVAL_P (next) && intervals_equal (i, next))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
365 next = next_interval (next);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
366
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
367 if (NULL_INTERVAL_P (next))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
368 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
369
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
370 return next->position;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
371 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
372
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
373 DEFUN ("previous-property-change", Fprevious_property_change,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
374 Sprevious_property_change, 2, 2, 0,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
375 "Return the position before POSITION in OBJECT which has properties\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
376 different from those at POSITION. OBJECT may be a string or buffer.\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
377 Returns nil if unsuccessful.")
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
378 (pos, object)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
379 Lisp_Object pos, object;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
380 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
381 register INTERVAL i, previous;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
382
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
383 i = validate_interval_range (object, &pos, &pos, soft);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
384 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
385 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
386
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
387 previous = previous_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
388 while (! NULL_INTERVAL_P (previous) && intervals_equal (previous, i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
389 previous = previous_interval (previous);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
390 if (NULL_INTERVAL_P (previous))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
391 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
392
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
393 return previous->position + LENGTH (previous) - 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
394 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
395
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
396 DEFUN ("add-text-properties", Fadd_text_properties,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
397 Sadd_text_properties, 4, 4, 0,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
398 "Add the PROPERTIES (a property list) to the text of OBJECT\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
399 (a string or buffer) in the range START to END. Returns t if any change\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
400 was made, nil otherwise.")
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
401 (object, start, end, properties)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
402 Lisp_Object object, start, end, properties;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
403 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
404 register INTERVAL i, unchanged;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
405 register int s, len, modified;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
406
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
407 properties = validate_plist (properties);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
408 if (NILP (properties))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
409 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
410
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
411 i = validate_interval_range (object, &start, &end, hard);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
412 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
413 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
414
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
415 s = XINT (start);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
416 len = XINT (end) - s;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
417
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
418 /* If we're not starting on an interval boundary, we have to
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
419 split this interval. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
420 if (i->position != s)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
421 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
422 /* If this interval already has the properties, we can
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
423 skip it. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
424 if (interval_has_all_properties (properties, i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
425 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
426 int got = (LENGTH (i) - (s - i->position));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
427 if (got >= len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
428 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
429 len -= got;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
430 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
431 else
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
432 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
433 unchanged = i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
434 i = split_interval_right (unchanged, s - unchanged->position + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
435 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
436 if (LENGTH (i) > len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
437 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
438 i = split_interval_left (i, len + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
439 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
440 add_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
441 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
442 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
443
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
444 add_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
445 modified = 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
446 len -= LENGTH (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
447 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
448 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
449 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
450
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
451 /* We are at the beginning of an interval, with len to scan */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
452 while (1)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
453 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
454 if (LENGTH (i) >= len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
455 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
456 if (interval_has_all_properties (properties, i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
457 return modified ? Qt : Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
458
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
459 if (LENGTH (i) == len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
460 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
461 add_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
462 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
463 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
464
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
465 /* i doesn't have the properties, and goes past the change limit */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
466 unchanged = i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
467 i = split_interval_left (unchanged, len + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
468 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
469 add_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
470 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
471 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
472
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
473 len -= LENGTH (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
474 modified += add_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
475 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
476 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
477 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
478
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
479 DEFUN ("set-text-properties", Fset_text_properties,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
480 Sset_text_properties, 4, 4, 0,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
481 "Make the text of OBJECT (a string or buffer) have precisely\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
482 PROPERTIES (a list of properties) in the range START to END.\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
483 \n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
484 If called with a valid property list, return t (text was changed).\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
485 Otherwise return nil.")
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
486 (object, start, end, properties)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
487 Lisp_Object object, start, end, properties;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
488 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
489 register INTERVAL i, unchanged;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
490 register int s, len;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
491
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
492 properties = validate_plist (properties);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
493 if (NILP (properties))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
494 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
495
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
496 i = validate_interval_range (object, &start, &end, hard);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
497 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
498 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
499
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
500 s = XINT (start);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
501 len = XINT (end) - s;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
502
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
503 if (i->position != s)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
504 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
505 unchanged = i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
506 i = split_interval_right (unchanged, s - unchanged->position + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
507 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
508 if (LENGTH (i) > len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
509 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
510 i = split_interval_left (i, len);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
511 set_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
512 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
513 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
514
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
515 set_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
516 len -= LENGTH (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
517 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
518 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
519
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
520 while (1)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
521 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
522 if (LENGTH (i) >= len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
523 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
524 if (LENGTH (i) == len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
525 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
526 set_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
527 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
528 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
529
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
530 i = split_interval_left (i, len + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
531 set_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
532 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
533 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
534
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
535 len -= LENGTH (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
536 set_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
537 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
538 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
539
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
540 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
541 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
542
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
543 DEFUN ("remove-text-properties", Fremove_text_properties,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
544 Sremove_text_properties, 4, 4, 0,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
545 "Remove the PROPERTIES (a property list) from the text of OBJECT\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
546 (a string or buffer) in the range START to END. Returns t if any change\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
547 was made, nil otherwise.")
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
548 (object, start, end, properties)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
549 Lisp_Object object, start, end, properties;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
550 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
551 register INTERVAL i, unchanged;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
552 register int s, len, modified;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
553
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
554 i = validate_interval_range (object, &start, &end, soft);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
555 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
556 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
557
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
558 s = XINT (start);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
559 len = XINT (end) - s;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
560 if (i->position != s)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
561 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
562 /* No properties on this first interval -- return if
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
563 it covers the entire region. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
564 if (! interval_has_some_properties (properties, i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
565 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
566 int got = (LENGTH (i) - (s - i->position));
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
567 if (got >= len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
568 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
569 len -= got;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
570 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
571 /* Remove the properties from this interval. If it's short
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
572 enough, return, splitting it if it's too short. */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
573 else
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
574 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
575 unchanged = i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
576 i = split_interval_right (unchanged, s - unchanged->position + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
577 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
578 if (LENGTH (i) > len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
579 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
580 i = split_interval_left (i, len + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
581 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
582 remove_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
583 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
584 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
585
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
586 remove_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
587 modified = 1;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
588 len -= LENGTH (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
589 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
590 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
591 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
592
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
593 /* We are at the beginning of an interval, with len to scan */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
594 while (1)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
595 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
596 if (LENGTH (i) >= len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
597 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
598 if (! interval_has_some_properties (properties, i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
599 return modified ? Qt : Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
600
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
601 if (LENGTH (i) == len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
602 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
603 remove_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
604 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
605 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
606
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
607 /* i has the properties, and goes past the change limit */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
608 unchanged = split_interval_right (i, len + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
609 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
610 remove_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
611 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
612 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
613
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
614 len -= LENGTH (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
615 modified += remove_properties (properties, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
616 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
617 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
618 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
619
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
620 DEFUN ("erase-text-properties", Ferase_text_properties,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
621 Serase_text_properties, 3, 3, 0,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
622 "Remove all text properties from OBJECT (a string or buffer), in the\n\
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
623 range START to END. Returns t if any change was made, nil otherwise.")
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
624 (object, start, end)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
625 Lisp_Object object, start, end;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
626 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
627 register INTERVAL i, unchanged;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
628 register int s, len, modified;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
629
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
630 i = validate_interval_range (object, &start, &end, soft);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
631 if (NULL_INTERVAL_P (i))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
632 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
633
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
634 s = XINT (start);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
635 len = XINT (end) - s;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
636 if (i->position != s)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
637 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
638 int got = LENGTH (i) - (s - i->position);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
639
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
640 if (got > len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
641 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
642 if (NILP (i->plist))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
643 return Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
644
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
645 unchanged = i;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
646 i = split_interval_right (unchanged, s - unchanged->position + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
647 i = split_interval_right (i, len + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
648 copy_properties (unchanged, i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
649 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
650 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
651
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
652 if (! NILP (i->plist))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
653 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
654 i = split_interval_right (i, s - i->position + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
655 modified++;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
656 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
657
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
658 len -= got;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
659 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
660 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
661
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
662 /* We are starting at the beginning of an interval */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
663 while (len > 0)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
664 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
665 if (LENGTH (i) > len)
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
666 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
667 if (NILP (i->plist))
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
668 return modified ? Qt : Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
669
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
670 i = split_interval_left (i, len + 1);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
671 return Qt;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
672 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
673
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
674 len -= LENGTH (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
675 modified += erase_properties (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
676 i = next_interval (i);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
677 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
678
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
679 return modified ? Qt : Qnil;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
680 }
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
681
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
682 void
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
683 syms_of_textprop ()
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
684 {
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
685 DEFVAR_INT ("interval-balance-threshold", &interval_balance_threshold,
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
686 "Threshold for rebalancing interval trees, expressed as the
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
687 percentage by which the left interval tree should not differ from the right.");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
688 interval_balance_threshold = 8;
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
689
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
690 /* Common attributes one might give text */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
691
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
692 staticpro (&Qforeground);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
693 Qforeground = intern ("foreground");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
694 staticpro (&Qbackground);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
695 Qbackground = intern ("background");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
696 staticpro (&Qfont);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
697 Qfont = intern ("font");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
698 staticpro (&Qstipple);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
699 Qstipple = intern ("stipple");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
700 staticpro (&Qunderline);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
701 Qunderline = intern ("underline");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
702 staticpro (&Qread_only);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
703 Qread_only = intern ("read-only");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
704 staticpro (&Qinvisible);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
705 Qinvisible = intern ("invisible");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
706
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
707 /* Properties that text might use to specify certain actions */
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
708
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
709 staticpro (&Qmouse_left);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
710 Qmouse_left = intern ("mouse-left");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
711 staticpro (&Qmouse_entered);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
712 Qmouse_entered = intern ("mouse-entered");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
713 staticpro (&Qpoint_left);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
714 Qpoint_left = intern ("point-left");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
715 staticpro (&Qpoint_entered);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
716 Qpoint_entered = intern ("point-entered");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
717 staticpro (&Qmodification);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
718 Qmodification = intern ("modification");
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
719
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
720 defsubr (&Stext_properties_at);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
721 defsubr (&Snext_property_change);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
722 defsubr (&Sprevious_property_change);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
723 defsubr (&Sadd_text_properties);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
724 defsubr (&Sset_text_properties);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
725 defsubr (&Sremove_text_properties);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
726 defsubr (&Serase_text_properties);
425f62908a54 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
727 }