# HG changeset patch # User Richard M. Stallman # Date 1018719997 0 # Node ID a7ca9a83f673109e8e17624b124365391e8394b1 # Parent a22b230e0b6ce3f0a9f227384cf427563936b6c8 (display_mode_element): Don't let mode_line_proptrans_alist grow without limit. Move recently used elements to the front. diff -r a22b230e0b6c -r a7ca9a83f673 src/xdisp.c --- a/src/xdisp.c Sat Apr 13 13:01:48 2002 +0000 +++ b/src/xdisp.c Sat Apr 13 17:46:37 2002 +0000 @@ -13695,15 +13695,28 @@ aelt = Fassoc (elt, mode_line_proptrans_alist); if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt)))) - elt = XCAR (aelt); + { + mode_line_proptrans_alist + = Fcons (aelt, Fdelq (aelt, mode_line_proptrans_alist)); + elt = XCAR (aelt); + } else { + Lisp_Object tem; + elt = Fcopy_sequence (elt); Fset_text_properties (make_number (0), Flength (elt), props, elt); + /* Add this item to mode_line_proptrans_alist. */ mode_line_proptrans_alist = Fcons (Fcons (elt, props), mode_line_proptrans_alist); + /* Truncate mode_line_proptrans_alist + to at most 50 elements. */ + tem = Fnthcdr (make_number (50), + mode_line_proptrans_alist); + if (! NILP (tem)) + XSETCDR (tem, Qnil); } } }