Index: src/textprop.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/textprop.c,v retrieving revision 1.127 diff -u -d -r1.127 textprop.c *** src/textprop.c 29 Apr 2002 19:29:58 -0000 1.127 --- src/textprop.c 4 Jun 2002 19:28:24 -0000 *************** *** 70,75 **** --- 70,76 ---- Lisp_Object Vinhibit_point_motion_hooks; Lisp_Object Vdefault_text_properties; + Lisp_Object Vchar_property_alias_alist; Lisp_Object Vtext_property_default_nonsticky; /* verify_interval_modification saves insertion hooks here *************** *** 2176,2181 **** --- 2177,2191 ---- The value of a property in this list is seen as the value for every character that does not have its own value for that property. */); Vdefault_text_properties = Qnil; + + DEFVAR_LISP ("char-property-alias-alist", &Vchar_property_alias_alist, + doc: /* Alist of alternative properties for properties without a value. + Each element should look like (PROPERTY ALTERNATIVE1 ALTERNATIVE2...). + If a piece of text has no direct value for a particular property, then + this alist is consulted. If that property appears in the alist, then + the first non-nil value from the associated alternative properties is + returned. */); + Vchar_property_alias_alist = Qnil; DEFVAR_LISP ("inhibit-point-motion-hooks", &Vinhibit_point_motion_hooks, doc: /* If non-nil, don't run `point-left' and `point-entered' text properties. Index: src/intervals.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/intervals.h,v retrieving revision 1.48 diff -u -d -r1.48 intervals.h *** src/intervals.h 14 Mar 2002 08:09:59 -0000 1.48 --- src/intervals.h 4 Jun 2002 19:28:24 -0000 *************** *** 267,272 **** --- 267,273 ---- extern Lisp_Object Vinhibit_point_motion_hooks; extern Lisp_Object Vdefault_text_properties; + extern Lisp_Object Vchar_property_alias_alist; extern Lisp_Object Vtext_property_default_nonsticky; /* Sticky properties */ Index: src/intervals.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/intervals.c,v retrieving revision 1.113 diff -u -d -r1.113 intervals.c *** src/intervals.c 14 Mar 2002 08:11:46 -0000 1.113 --- src/intervals.c 4 Jun 2002 19:28:24 -0000 *************** *** 1813,1820 **** Lisp_Object plist; register Lisp_Object prop; { ! register Lisp_Object tail, fallback; ! fallback = Qnil; for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail))) { --- 1813,1828 ---- Lisp_Object plist; register Lisp_Object prop; { ! textget_internal (plist, prop, 1); ! } ! ! Lisp_Object ! textget_internal (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,1840 **** if (! NILP (fallback)) return fallback; ! if (CONSP (Vdefault_text_properties)) ! return Fplist_get (Vdefault_text_properties, prop); ! return Qnil; } --- 1840,1859 ---- if (! NILP (fallback)) return fallback; ! /* 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; } Index: src/buffer.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/buffer.c,v retrieving revision 1.387 diff -u -d -r1.387 buffer.c *** src/buffer.c 3 Jun 2002 18:03:14 -0000 1.387 --- src/buffer.c 4 Jun 2002 19:28:24 -0000 *************** *** 3912,3939 **** (overlay, prop) Lisp_Object overlay, prop; { - Lisp_Object plist, fallback; - CHECK_OVERLAY (overlay); ! ! fallback = Qnil; ! ! for (plist = XOVERLAY (overlay)->plist; ! CONSP (plist) && CONSP (XCDR (plist)); ! plist = XCDR (XCDR (plist))) ! { ! if (EQ (XCAR (plist), prop)) ! return XCAR (XCDR (plist)); ! else if (EQ (XCAR (plist), Qcategory)) ! { ! Lisp_Object tem; ! tem = Fcar (Fcdr (plist)); ! if (SYMBOLP (tem)) ! fallback = Fget (tem, prop); ! } ! } ! ! return fallback; } DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, --- 3912,3919 ---- (overlay, prop) Lisp_Object overlay, prop; { CHECK_OVERLAY (overlay); ! return textget_internal (XOVERLAY (overlay)->plist, prop, 0); } DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0,