aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2002-04-13 17:46:37 +0000
committerRichard M. Stallman2002-04-13 17:46:37 +0000
commitadb63af12a7ad22e19b6d3ae45ddff768a5e86d1 (patch)
tree9fa7ab3f83879c60fdf30f35639076d0dc0e6997 /src
parenta2c060f6b4df8acbee68ff669d5265853bfe43e3 (diff)
downloademacs-adb63af12a7ad22e19b6d3ae45ddff768a5e86d1.tar.gz
emacs-adb63af12a7ad22e19b6d3ae45ddff768a5e86d1.zip
(display_mode_element): Don't let mode_line_proptrans_alist
grow without limit. Move recently used elements to the front.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 107218b928b..53770a4b138 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13695,15 +13695,28 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
13695 13695
13696 aelt = Fassoc (elt, mode_line_proptrans_alist); 13696 aelt = Fassoc (elt, mode_line_proptrans_alist);
13697 if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt)))) 13697 if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt))))
13698 elt = XCAR (aelt); 13698 {
13699 mode_line_proptrans_alist
13700 = Fcons (aelt, Fdelq (aelt, mode_line_proptrans_alist));
13701 elt = XCAR (aelt);
13702 }
13699 else 13703 else
13700 { 13704 {
13705 Lisp_Object tem;
13706
13701 elt = Fcopy_sequence (elt); 13707 elt = Fcopy_sequence (elt);
13702 Fset_text_properties (make_number (0), Flength (elt), 13708 Fset_text_properties (make_number (0), Flength (elt),
13703 props, elt); 13709 props, elt);
13710 /* Add this item to mode_line_proptrans_alist. */
13704 mode_line_proptrans_alist 13711 mode_line_proptrans_alist
13705 = Fcons (Fcons (elt, props), 13712 = Fcons (Fcons (elt, props),
13706 mode_line_proptrans_alist); 13713 mode_line_proptrans_alist);
13714 /* Truncate mode_line_proptrans_alist
13715 to at most 50 elements. */
13716 tem = Fnthcdr (make_number (50),
13717 mode_line_proptrans_alist);
13718 if (! NILP (tem))
13719 XSETCDR (tem, Qnil);
13707 } 13720 }
13708 } 13721 }
13709 } 13722 }