Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
0b0737d1
Commit
0b0737d1
authored
Sep 26, 1999
by
Gerd Moellmann
Browse files
(next_single_char_property_change): New.
parent
50075fa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
src/textprop.c
src/textprop.c
+54
-0
No files found.
src/textprop.c
View file @
0b0737d1
...
...
@@ -675,6 +675,60 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.")
}
return
Fprevious_property_change
(
position
,
Qnil
,
temp
);
}
/* Value is the position in OBJECT after POS where the value of
property PROP changes. OBJECT must be a string or buffer. If
OBJECT is nil, use the current buffer. LIMIT if not nil limits the
search. */
Lisp_Object
next_single_char_property_change
(
pos
,
prop
,
object
,
limit
)
Lisp_Object
prop
,
pos
,
object
,
limit
;
{
if
(
STRINGP
(
object
))
{
pos
=
Fnext_single_property_change
(
pos
,
prop
,
object
,
limit
);
if
(
NILP
(
pos
))
{
if
(
NILP
(
limit
))
pos
=
make_number
(
XSTRING
(
object
)
->
size
);
else
pos
=
limit
;
}
}
else
{
Lisp_Object
initial_value
,
value
;
struct
buffer
*
old_current_buffer
=
NULL
;
int
count
=
specpdl_ptr
-
specpdl
;
if
(
!
NILP
(
object
))
CHECK_BUFFER
(
object
,
0
);
if
(
BUFFERP
(
object
)
&&
current_buffer
!=
XBUFFER
(
object
))
{
record_unwind_protect
(
Fset_buffer
,
Fcurrent_buffer
());
Fset_buffer
(
object
);
}
initial_value
=
Fget_char_property
(
pos
,
prop
,
object
);
while
(
XFASTINT
(
pos
)
<
XFASTINT
(
limit
))
{
pos
=
Fnext_char_property_change
(
pos
,
limit
);
value
=
Fget_char_property
(
pos
,
prop
,
object
);
if
(
!
EQ
(
value
,
initial_value
))
break
;
}
unbind_to
(
count
,
Qnil
);
}
return
pos
;
}
DEFUN
(
"next-property-change"
,
Fnext_property_change
,
Snext_property_change
,
1
,
3
,
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment