Mercurial > hg > xemacs-beta
diff src/alloc.c @ 1154:3136b3c99ceb
[xemacs-hg @ 2002-12-12 03:20:35 by stephent]
GC messages optional <877keg6i2y.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Thu, 12 Dec 2002 03:20:43 +0000 |
parents | 37bdd24225ef |
children | e22b0213b713 |
line wrap: on
line diff
--- a/src/alloc.c Wed Dec 11 22:53:28 2002 +0000 +++ b/src/alloc.c Thu Dec 12 03:20:43 2002 +0000 @@ -170,6 +170,10 @@ /* Nonzero during gc */ int gc_in_progress; +/* Nonzero means display messages at beginning and end of GC. */ + +int garbage_collection_messages; + /* Number of times GC has happened at this level or below. * Level 0 is most volatile, contrary to usual convention. * (Of course, there's only one level at present) */ @@ -4302,13 +4306,16 @@ /* Don't print messages to the stream device. */ if (!cursor_changed && !FRAME_STREAM_P (f)) { - Lisp_Object args[2], whole_msg; - args[0] = (STRINGP (Vgc_message) ? Vgc_message : - build_msg_string (gc_default_message)); - args[1] = build_string ("..."); - whole_msg = Fconcat (2, args); - echo_area_message (f, (Ibyte *) 0, whole_msg, 0, -1, - Qgarbage_collecting); + if (garbage_collection_messages) + { + Lisp_Object args[2], whole_msg; + args[0] = (STRINGP (Vgc_message) ? Vgc_message : + build_msg_string (gc_default_message)); + args[1] = build_string ("..."); + whole_msg = Fconcat (2, args); + echo_area_message (f, (Ibyte *) 0, whole_msg, 0, -1, + Qgarbage_collecting); + } } } @@ -4463,14 +4470,17 @@ if (NILP (clear_echo_area (selected_frame (), Qgarbage_collecting, 0))) { - Lisp_Object args[2], whole_msg; - args[0] = (STRINGP (Vgc_message) ? Vgc_message : - build_msg_string (gc_default_message)); - args[1] = build_msg_string ("... done"); - whole_msg = Fconcat (2, args); - echo_area_message (selected_frame (), (Ibyte *) 0, - whole_msg, 0, -1, - Qgarbage_collecting); + if (garbage_collection_messages) + { + Lisp_Object args[2], whole_msg; + args[0] = (STRINGP (Vgc_message) ? Vgc_message : + build_msg_string (gc_default_message)); + args[1] = build_msg_string ("... done"); + whole_msg = Fconcat (2, args); + echo_area_message (selected_frame (), (Ibyte *) 0, + whole_msg, 0, -1, + Qgarbage_collecting); + } } } } @@ -5076,6 +5086,11 @@ This means that certain objects should be allocated in readonly space. */ ); + DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages /* + Non-nil means display messages at start and end of garbage collection. +*/ ); + garbage_collection_messages = 0; + DEFVAR_LISP ("pre-gc-hook", &Vpre_gc_hook /* Function or functions to be run just before each garbage collection. Interrupts, garbage collection, and errors are inhibited while this hook