From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: messages override minibuffer input Date: Mon, 10 Sep 2007 14:41:26 -0700 (PDT) Message-ID: <38233.128.165.123.18.1189460486.squirrel@webmail.lanl.gov> References: <18146.9183.561171.347511@tfkp07.physik.uni-erlangen.de> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1189462467 21501 80.91.229.12 (10 Sep 2007 22:14:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2007 22:14:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Roland Winkler" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 11 08:14:14 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IUyWD-0003mT-IE for ged-emacs-devel@m.gmane.org; Tue, 11 Sep 2007 07:42:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUr1q-0002nO-U4 for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2007 17:42:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUr0h-0001uH-AQ for emacs-devel@gnu.org; Mon, 10 Sep 2007 17:41:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUr0f-0001sX-54 for emacs-devel@gnu.org; Mon, 10 Sep 2007 17:41:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUr0f-0001sP-1B for emacs-devel@gnu.org; Mon, 10 Sep 2007 17:41:33 -0400 Original-Received: from mailwasher.lanl.gov ([192.65.95.54] helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IUr0e-00065Q-Ds for emacs-devel@gnu.org; Mon, 10 Sep 2007 17:41:32 -0400 Original-Received: from mailrelay3.lanl.gov (mailrelay3.lanl.gov [128.165.4.104]) by mailwasher-b.lanl.gov (8.13.8/8.13.6/(ccn-5)) with ESMTP id l8ALfUDO019837; Mon, 10 Sep 2007 15:41:30 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay3.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l8ALfRO1012751; Mon, 10 Sep 2007 15:41:27 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id l8ALfRaJ019287; Mon, 10 Sep 2007 15:41:27 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id l8ALfRQw019284; Mon, 10 Sep 2007 14:41:27 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.18 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Mon, 10 Sep 2007 14:41:26 -0700 (PDT) In-Reply-To: <18146.9183.561171.347511@tfkp07.physik.uni-erlangen.de> User-Agent: SquirrelMail/1.4.8-6.el3.2lanl X-Priority: 3 (Normal) Importance: Normal X-CTN-5-MailScanner-Information: Please see http://network.lanl.gov/email/virus-scan.php X-CTN-5-MailScanner: Found to be clean X-CTN-5-MailScanner-From: herring@lanl.gov X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:78510 Archived-At: > I am always annoyed when emacs is waiting for input in the > minibuffer, and in the meanwhile an (idle-) timer function kicks in, > producing a message that overrides the content displayed in the > minibuffer. I was once told that timer functions should be designed > such that they do not produce any output. I do not know whether this > is always a good strategy. On the other hand, I do not know how many > (too many?) packages violate such a strategy. (Probably, it would > help if the elisp manual gave a recommendation concerning the usage > of noisy functions inside timer functions.) When I have written timers that produced output, it has been "informational" output which is not critical to see; then I have merely skipped printing unless the echo area either is empty or contains my timer's previous output, and the minibuffer is not active. Would this be a good general function to provide? (What follows is not tested; I don't have known-working code to hand.) (defvar optional-message nil "The last message shown with the function `optional-message'.") (defun optional-message (fmt &rest args) "Display a message if there's nothing better being displayed." (or (active-minibuffer-window) (not (eq (current-message) optional-message)) (message "%s" (setq optional-message (apply 'format fmt args))))) I suppose some provision could be made for putting the message into *Messages* even if it's not displayed, but I'm not sure what the best way to do that is. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.