--- src/xdisp.c.~1.908.~ 2004-09-16 02:12:32.000000000 +0700 +++ src/xdisp.c 2004-09-17 09:17:14.626506584 +0700 @@ -15335,23 +15335,34 @@ Lisp_Object oprops, aelt; oprops = Ftext_properties_at (make_number (0), elt); + /* If the first character doesn't have any properties, try + the last character instead, since user code might not + propertize a leading space character. */ + + if (NILP (oprops)) + { + int length; + + length = XFASTINT (Flength (elt)); + if (length > 0) + oprops = Ftext_properties_at (make_number (length - 1), elt); + } + + if (NILP (Fequal (props, oprops)) || risky) { /* If the starting string has properties, - merge the specified ones onto the existing ones. */ + merge the specified ones onto the existing ones. + Give priority to the existing one. */ if (! NILP (oprops) && !risky) { - Lisp_Object tem; - - oprops = Fcopy_sequence (oprops); - tem = props; - while (CONSP (tem)) + props = Fcopy_sequence (props); + while (CONSP (oprops)) { - oprops = Fplist_put (oprops, XCAR (tem), - XCAR (XCDR (tem))); - tem = XCDR (XCDR (tem)); + props = Fplist_put (props, XCAR (oprops), + XCAR (XCDR (oprops))); + oprops = XCDR (XCDR (oprops)); } - props = oprops; } aelt = Fassoc (elt, mode_line_proptrans_alist);