help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to suppress messages?


From: Thien-Thi Nguyen
Subject: Re: How to suppress messages?
Date: Fri, 28 Jan 2005 00:45:59 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

John Paul Wallington <jpw@gnu.org>:

> Not recommended [...]

while we're unrecommending things, below is some more unrecommended
(five-minute sketch, incomplete, not exactly pretty result) stuff...

thi

____________________________________
cvs diff editfns.c xdisp.c
Index: editfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/editfns.c,v
retrieving revision 1.389
diff -w -b -B -u -r1.389 editfns.c
--- editfns.c   21 Jan 2005 00:32:36 -0000      1.389
+++ editfns.c   27 Jan 2005 23:38:58 -0000
@@ -3114,6 +3114,8 @@
 /* Allocated length of that buffer.  */
 static int message_length;
 
+Lisp_Object Vmessage_stfu_dammit;
+
 DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
        doc: /* Print a one-line message at the bottom of the screen.
 The message also goes into the `*Messages*' buffer.
@@ -3125,11 +3127,16 @@
 If the first argument is nil, the function clears any existing message;
 this lets the minibuffer contents show.  See also `current-message'.
 
+TTN curmudgeon hack: Non-nil `message-stfu-dammit' inhibits everything.
+
 usage: (message STRING &rest ARGS)  */)
      (nargs, args)
      int nargs;
      Lisp_Object *args;
 {
+  if (! NILP (Vmessage_stfu_dammit))
+    return Qnil;
+
   if (NILP (args[0])
       || (STRINGP (args[0])
          && SBYTES (args[0]) == 0))
@@ -4271,6 +4278,10 @@
 {
   environbuf = 0;
 
+  DEFVAR_LISP ("message-stfu-dammit", &Vmessage_stfu_dammit,
+              doc: /* Non-nil makes `message' a no-op.  */);
+  Vmessage_stfu_dammit = Qnil;
+
   Qbuffer_access_fontify_functions
     = intern ("buffer-access-fontify-functions");
   staticpro (&Qbuffer_access_fontify_functions);
Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.974
diff -w -b -B -u -r1.974 xdisp.c
--- xdisp.c     27 Jan 2005 22:33:52 -0000      1.974
+++ xdisp.c     27 Jan 2005 23:39:04 -0000
@@ -7045,6 +7045,14 @@
      char *m;
      EMACS_INT a1, a2, a3;
 {
+  /* TTN curmudgeon hack (same as for `Fmessage'):
+     Non-nil `message-stfu-dammit' inhibits everything.  */
+  extern Lisp_Object Vmessage_stfu_dammit;
+
+  if (! NILP (Vmessage_stfu_dammit))
+    return;
+  /* We now return you to your regularly spewful Emacs...  */
+
   if (noninteractive)
     {
       if (m)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]