# HG changeset patch # User Colin Walters # Date 1023567917 0 # Node ID b9f2c8b7c60ef9277b37b7fc27528a207ed78e62 # Parent 322be4c4e11d8f0b13ce046875cb3f0086171760 (lookup_char_property): New function for looking up overlay and text properties, created from textget. (textget): Use it. diff -r 322be4c4e11d -r b9f2c8b7c60e src/intervals.c --- a/src/intervals.c Sat Jun 08 20:24:55 2002 +0000 +++ b/src/intervals.c Sat Jun 08 20:25:17 2002 +0000 @@ -1813,8 +1813,16 @@ Lisp_Object plist; register Lisp_Object prop; { - register Lisp_Object tail, fallback; - fallback = Qnil; + lookup_char_property (plist, prop, 1); +} + +Lisp_Object +lookup_char_property (plist, prop, textprop) + Lisp_Object plist; + register Lisp_Object prop; + int textprop; +{ + register Lisp_Object tail, fallback = Qnil; for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail))) { @@ -1832,9 +1840,20 @@ if (! NILP (fallback)) return fallback; - if (CONSP (Vdefault_text_properties)) - return Fplist_get (Vdefault_text_properties, prop); - return Qnil; + /* Check for alternative properties */ + tail = Fassq (prop, Vchar_property_alias_alist); + if (NILP (tail)) + return tail; + tail = XCDR (tail); + for (; NILP (fallback) && !NILP (tail); tail = XCDR (tail)) + { + if (!CONSP (tail)) + wrong_type_argument (Qlistp, tail); + fallback = Fplist_get (plist, XCAR (tail)); + } + if (textprop && NILP (fallback) && CONSP (Vdefault_text_properties)) + fallback = Fplist_get (Vdefault_text_properties, prop); + return fallback; }