emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master df61b07: Add a new `inhibit-message' variable


From: Oleh Krehel
Subject: [Emacs-diffs] master df61b07: Add a new `inhibit-message' variable
Date: Wed, 22 Apr 2015 13:07:40 +0000

branch: master
commit df61b078228d8ee62abc9b03ae357a867c1013b3
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Add a new `inhibit-message' variable
    
    * src/xdisp.c (syms_of_xdisp): Define a boolean `inhibit_message'.
    (message3): Don't call `message3_nolog' (i.e. use the Echo Area) when
    `inhibit_message' is non-zero.
    
    * etc/NEWS: Add an entry.
    
    * doc/lispref/display.texi: Add an entry for `inhibit-message',
      mention it in `message'.
---
 doc/lispref/display.texi |    8 ++++++++
 etc/NEWS                 |    5 +++++
 src/xdisp.c              |    9 +++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index e2a38b6..d5d9bb5 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -257,6 +257,9 @@ text properties (@pxref{Logging Messages}).
 In batch mode, the message is printed to the standard error stream,
 followed by a newline.
 
+When @code{inhibit-message} is address@hidden, no message will be displayed
+in the echo area, it will only be logged to @samp{*Messages*}.
+
 If @var{format-string} is @code{nil} or the empty string,
 @code{message} clears the echo area; if the echo area has been
 expanded automatically, this brings it back to its normal size.  If
@@ -282,6 +285,11 @@ To automatically display a message in the echo area or in 
a pop-buffer,
 depending on its size, use @code{display-message-or-buffer} (see below).
 @end defun
 
address@hidden inhibit-message
+When this variable is address@hidden, @code{message} and related functions
+will not use the Echo Area to display messages.
address@hidden defvar
+
 @defmac with-temp-message message &rest body
 This construct displays a message in the echo area temporarily, during
 the execution of @var{body}.  It displays @var{message}, executes
diff --git a/etc/NEWS b/etc/NEWS
index 804b819..e2b6b11 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -200,6 +200,11 @@ font, and (iii) the specified window.
 
 ** New possible value for `system-type': nacl.
 
++++
+** New variable `inhibit-message', when bound to non-nil, inhibits
+   `message' and related functions from displaying messages the Echo
+   Area.  The output is still logged to the *Messages* buffer.
+
 
 * Editing Changes in Emacs 25.1
 
diff --git a/src/xdisp.c b/src/xdisp.c
index a17f5a9..6ca1906 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10053,8 +10053,8 @@ message3 (Lisp_Object m)
       message_dolog (buffer, nbytes, true, multibyte);
       SAFE_FREE ();
     }
-  message3_nolog (m);
-
+  if (! inhibit_message)
+    message3_nolog (m);
   UNGCPRO;
 }
 
@@ -30430,6 +30430,11 @@ syms_of_xdisp (void)
 
   DEFSYM (Qredisplay_internal, "redisplay_internal (C function)");
 
+  DEFVAR_BOOL("inhibit-message", inhibit_message,
+              doc:  /* Non-nil means calls to `message' are not displayed.
+They are still logged to the *Messages* buffer.  */);
+  inhibit_message = 0;
+
   message_dolog_marker1 = Fmake_marker ();
   staticpro (&message_dolog_marker1);
   message_dolog_marker2 = Fmake_marker ();



reply via email to

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