Function: get-char-property-and-overlay
get-char-property-and-overlay is a function defined in textprop.c.
Signature
(get-char-property-and-overlay POSITION PROP &optional OBJECT)
Documentation
Like get-char-property, but with extra overlay information.
The value is a cons cell. Its car is the return value of get-char-property
with the same arguments--that is, the value of POSITION's property
PROP in OBJECT. Its cdr is the overlay in which the property was
found, or nil, if it was found as a text property or not found at all.
OBJECT is optional and defaults to the current buffer. OBJECT may be a string, a buffer or a window. For strings, the cdr of the return value is always nil, since strings do not have overlays. If OBJECT is a window, then that window's buffer is used, but window-specific overlays are considered only if they are associated with OBJECT. If POSITION is at the end of OBJECT, both car and cdr are nil.
Other relevant functions are documented in the text-properties group.
Probably introduced at or before Emacs version 22.1.
Shortdoc
;; text-properties
(get-char-property-and-overlay 0 'foo (propertize "x" 'foo t))
=> (t)
Source Code
// Defined in /usr/src/emacs/src/textprop.c
{
Lisp_Object overlay;
Lisp_Object val
= get_char_property_and_overlay (position, prop, object, &overlay);
return Fcons (val, overlay);
}