From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tom Capey Newsgroups: gmane.emacs.help Subject: Re: How to suppress messages? Date: Fri, 28 Jan 2005 07:43:35 +0000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1106898457 7304 80.91.229.6 (28 Jan 2005 07:47:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2005 07:47:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 28 08:47:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CuQqp-0003WJ-00 for ; Fri, 28 Jan 2005 08:47:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CuR3B-0005pZ-HC for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jan 2005 03:00:17 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!sn-xit-02!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:HhPaeL5/Qcc19pUHiGLIVCm8KRE= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 56 Original-Xref: shelby.stanford.edu gnu.emacs.help:128218 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23720 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23720 * Drew Adams writes: >> I couldn't find any mention in the Elisp manual of a way to >> do this. If I >> have a function that calls a function (a built-in, as it >> turns out) that >> calls (message...), how can my function stop the message from being >> displayed by the called function? > I don't think there is a way to disable messages in the echo area, > except perhaps some clever trick. > The usual way to avoid messages is not to call functions that are > meant for interactive invocation, but instead use their > non-interactive subroutines. > Of course. However, there may not always be such a choice. As I mentioned, > this particular occurrence concerns a call to `default-boundp' that (in > Emacs 20) thinks it needs to display a message. I had a similar problem in > Emacs 21 with `xw-defined-colors' calling `message' (bug has been filed). > One can't expect bugs in previous Emacs versions to be corrected, of course. > It's too bad that there is no way to inhibit messages, IMO. You could always use `let' from the cl package: (require 'cl) (defun foobar () (message "hello from foobar") (sit-for 1) (flet ((message (arg) nil)) (message "hello from foobar's flet") (sit-for 1) (bar)) (message "goodbye")) (defun bar () (message "hello from bar") (sit-for 1)) (foobar) And output in the *Messages* buffer: hello from foobar goodbye /Tom -- I for one welcome our new key-chord-requiring self-documenting extensible OS-in-an-editor Emacs overlord. -- Jock Cooper