aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuc Teirlinck2003-11-30 17:08:28 +0000
committerLuc Teirlinck2003-11-30 17:08:28 +0000
commit97a1bc6376397911333f1decc764379fce397728 (patch)
tree2ee4ffc846e87171cc37104676433a986a7a1fe5 /src
parent9f8a930d980e626fdd627694143b11f29ecd4f24 (diff)
downloademacs-97a1bc6376397911333f1decc764379fce397728.tar.gz
emacs-97a1bc6376397911333f1decc764379fce397728.zip
(Fget_char_property_and_overlay): New function.
(syms_of_textprop): Defsubr it.
Diffstat (limited to 'src')
-rw-r--r--src/textprop.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/textprop.c b/src/textprop.c
index a243eb6c917..4f13aefb1be 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -703,6 +703,30 @@ overlays are considered only if they are associated with OBJECT. */)
703{ 703{
704 return get_char_property_and_overlay (position, prop, object, 0); 704 return get_char_property_and_overlay (position, prop, object, 0);
705} 705}
706
707DEFUN ("get-char-property-and-overlay", Fget_char_property_and_overlay,
708 Sget_char_property_and_overlay, 2, 3, 0,
709 doc: /* Like `get-char-property', but with extra overlay information.
710Return a cons whose car is the return value of `get-char-property'
711with the same arguments, that is, the value of POSITION's property
712PROP in OBJECT, and whose cdr is the overlay in which the property was
713found, or nil, if it was found as a text property or not found at all.
714OBJECT is optional and defaults to the current buffer. OBJECT may be
715a string, a buffer or a window. For strings, the cdr of the return
716value is always nil, since strings do not have overlays. If OBJECT is
717a window, then that window's buffer is used, but window-specific
718overlays are considered only if they are associated with OBJECT. If
719POSITION is at the end of OBJECT, both car and cdr are nil. */)
720 (position, prop, object)
721 Lisp_Object position, object;
722 register Lisp_Object prop;
723{
724 Lisp_Object overlay;
725 Lisp_Object val
726 = get_char_property_and_overlay (position, prop, object, &overlay);
727 return Fcons(val, overlay);
728}
729
706 730
707DEFUN ("next-char-property-change", Fnext_char_property_change, 731DEFUN ("next-char-property-change", Fnext_char_property_change,
708 Snext_char_property_change, 1, 2, 0, 732 Snext_char_property_change, 1, 2, 0,
@@ -2277,6 +2301,7 @@ rear-nonsticky properties of the character overrides NONSTICKINESS. */);
2277 defsubr (&Stext_properties_at); 2301 defsubr (&Stext_properties_at);
2278 defsubr (&Sget_text_property); 2302 defsubr (&Sget_text_property);
2279 defsubr (&Sget_char_property); 2303 defsubr (&Sget_char_property);
2304 defsubr (&Sget_char_property_and_overlay);
2280 defsubr (&Snext_char_property_change); 2305 defsubr (&Snext_char_property_change);
2281 defsubr (&Sprevious_char_property_change); 2306 defsubr (&Sprevious_char_property_change);
2282 defsubr (&Snext_single_char_property_change); 2307 defsubr (&Snext_single_char_property_change);