diff options
| author | Luc Teirlinck | 2003-11-30 17:08:28 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2003-11-30 17:08:28 +0000 |
| commit | 97a1bc6376397911333f1decc764379fce397728 (patch) | |
| tree | 2ee4ffc846e87171cc37104676433a986a7a1fe5 /src | |
| parent | 9f8a930d980e626fdd627694143b11f29ecd4f24 (diff) | |
| download | emacs-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.c | 25 |
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 | |||
| 707 | DEFUN ("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. | ||
| 710 | Return a cons whose car is the return value of `get-char-property' | ||
| 711 | with the same arguments, that is, the value of POSITION's property | ||
| 712 | PROP in OBJECT, and whose cdr is the overlay in which the property was | ||
| 713 | found, or nil, if it was found as a text property or not found at all. | ||
| 714 | OBJECT is optional and defaults to the current buffer. OBJECT may be | ||
| 715 | a string, a buffer or a window. For strings, the cdr of the return | ||
| 716 | value is always nil, since strings do not have overlays. If OBJECT is | ||
| 717 | a window, then that window's buffer is used, but window-specific | ||
| 718 | overlays are considered only if they are associated with OBJECT. If | ||
| 719 | POSITION 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 | ||
| 707 | DEFUN ("next-char-property-change", Fnext_char_property_change, | 731 | DEFUN ("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); |