changeset 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 32656d8c7b09
children 2e45c3beb9dc
files lisp/ChangeLog lisp/cus-start.el src/ChangeLog src/alloc.c
diffstat 4 files changed, 41 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Dec 11 22:53:28 2002 +0000
+++ b/lisp/ChangeLog	Thu Dec 12 03:20:43 2002 +0000
@@ -1,3 +1,7 @@
+2002-12-03  John Paul Wallington  <jpw@shootybangbang.com>
+
+	* cus-start.el (garbage-collection-messages): Add.
+
 2002-12-02  Mike Sperber <mike@xemacs.org>
 
 	* The Great Window Configuration rewrite: Re-implement window
--- a/lisp/cus-start.el	Wed Dec 11 22:53:28 2002 +0000
+++ b/lisp/cus-start.el	Thu Dec 12 03:20:43 2002 +0000
@@ -49,6 +49,7 @@
 	     (debug-on-quit debug boolean)
 	     (delete-auto-save-files auto-save boolean)
 	     (delete-exited-processes processes-basics boolean)
+	     (garbage-collection-messages alloc boolean)
 	     (indent-tabs-mode editing-basics boolean)
 	     (load-ignore-elc-files maint boolean)
 	     (load-ignore-out-of-date-elc-files maint boolean)
--- a/src/ChangeLog	Wed Dec 11 22:53:28 2002 +0000
+++ b/src/ChangeLog	Thu Dec 12 03:20:43 2002 +0000
@@ -1,3 +1,9 @@
+2002-12-03  John Paul Wallington  <jpw@shootybangbang.com>
+
+	* alloc.c (garbage_collection_messages): New variable.
+	(vars_of_alloc): Declare and initialise it.
+	(garbage_collect_1): Respect it.
+
 2002-12-02  Mike Sperber <mike@xemacs.org>
 
 	* The Great Window Configuration rewrite: Re-implement window
--- 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