From: Joe Corneli <jcorneli@math.utexas.edu>
Subject: Re: How to suppress messages?
Date: Fri, 28 Jan 2005 12:56:39 -0600 [thread overview]
Message-ID: <E1CubIN-0008Vo-00@lab45.ma.utexas.edu> (raw)
In-Reply-To: <FDELKNEBLPKKDCEBEJCBMEHECLAA.drew.adams@oracle.com>
This is how I do it, quite heavy duty.
(defvar messaging-on nil
"Control whether or not messages will be printed; by default,
they are not.")
;; Note that by itself this renders edebug pretty useless.
(defadvice message (around nomessage activate)
"Turn off messaging most of the time.
Whether or not messages are displayed is determined by the value
of the variable `messaging-on'."
(when messaging-on
ad-do-it))
;; This is what is needed to make edebug work even
;; when the `nomessage' advice is in effect.
(defadvice edebug-previous-result (around override-nomessage activate)
"Make edebug work when messaging is turned off by default."
(let ((messaging-on t))
ad-do-it))
(defadvice write-region (around no-wrote-file activate)
"Turn off the printout associated with writing files.
This is necessary to add as a supplement to `nomessage' because
the \"Wrote file\" message is not printed through the `message'
mechanism. The observed effect of this piece of advice is that
neither `save-buffer' nor `write-file' will print anything out
when they run."
(if messaging-on
ad-do-it
(set-buffer-modified-p nil)
(ad-set-arg 4 1)
(ad-set-arg 6 nil)
ad-do-it))
(defun turn-messaging-off ()
(interactive)
(ad-enable-advice 'message 'around 'nomessage)
(ad-activate 'message)
(ad-enable-advice 'write-region 'around 'no-wrote-file)
(ad-activate 'write-region))
(defun turn-messaging-on ()
(interactive)
(ad-disable-advice 'message 'around 'nomessage)
(ad-activate 'message)
(ad-disable-advice 'write-region 'around 'no-wrote-file)
(ad-activate 'write-region))
(defun my-message (str)
"Send a message, overriding our usual advice."
(let ((messaging-on t))
(message str)))
next prev parent reply other threads:[~2005-01-28 18:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.15741.1106847668.27204.help-gnu-emacs@gnu.org>
2005-01-28 7:43 ` How to suppress messages? Tom Capey
2005-01-28 8:20 ` Tom Capey
2005-01-28 15:06 ` Drew Adams
2005-01-28 18:56 ` Joe Corneli [this message]
2005-01-26 23:25 Drew Adams
2005-01-27 0:33 ` Edward O'Connor
2005-01-27 1:03 ` Drew Adams
2005-01-27 5:15 ` Eli Zaretskii
2005-01-27 17:24 ` Drew Adams
2005-01-27 20:50 ` John Paul Wallington
2005-01-27 21:10 ` Drew Adams
2005-01-27 23:18 ` T. V. Raman
[not found] ` <mailman.15770.1106861744.27204.help-gnu-emacs@gnu.org>
2005-01-27 23:45 ` Thien-Thi Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1CubIN-0008Vo-00@lab45.ma.utexas.edu \
--to=jcorneli@math.utexas.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.