unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Davis Herring" <herring@lanl.gov>
To: "Roland Winkler" <Roland.Winkler@physik.uni-erlangen.de>
Cc: emacs-devel@gnu.org
Subject: Re: messages override minibuffer input
Date: Mon, 10 Sep 2007 14:41:26 -0700 (PDT)	[thread overview]
Message-ID: <38233.128.165.123.18.1189460486.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <18146.9183.561171.347511@tfkp07.physik.uni-erlangen.de>

> 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.

  parent reply	other threads:[~2007-09-10 21:41 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-08  4:23 messages override minibuffer input Roland Winkler
2007-09-08 14:48 ` Stefan Monnier
2007-09-10 21:41 ` Davis Herring [this message]
2007-09-11 20:30   ` Richard Stallman
2007-09-12 22:32     ` Davis Herring
2007-09-13  3:23       ` Luc Teirlinck
2007-09-13  4:23         ` Davis Herring
2007-09-14  7:05       ` Richard Stallman
2007-09-12  9:25   ` Johannes Weiner
2007-09-12 10:24     ` Johannes Weiner
2007-09-12 16:25       ` Davis Herring
2007-09-12 16:28     ` Davis Herring
     [not found] ` <E1IUCJ9-0000VV-9H@fencepost.gnu.org>
2007-09-16  3:23   ` Roland Winkler
2007-09-17  0:20     ` Richard Stallman
2007-09-17 14:49       ` Roland Winkler
2007-09-17 22:24         ` Richard Stallman
2007-09-22 15:18           ` Roland Winkler
2007-09-23  9:07             ` Richard Stallman
2007-09-23 15:08               ` Roland Winkler
2007-09-23 21:54                 ` Richard Stallman
2007-09-23 23:33                   ` Roland Winkler
2007-09-24 18:19                     ` Richard Stallman
2007-09-25  1:06                       ` Roland Winkler
2007-09-24  0:24                   ` Drew Adams
2007-09-24  1:28                     ` Roland Winkler
2007-09-24  2:02                       ` Drew Adams
2007-09-24  3:20                         ` Roland Winkler
2007-09-24 10:36                         ` Robert J. Chassell
2007-09-24 15:08                           ` Drew Adams
2007-09-24 16:11                             ` Robert J. Chassell
2007-09-24 16:53                               ` Drew Adams
2007-09-24 10:43                   ` Johannes Weiner
2007-09-24 11:12                     ` David Kastrup
2007-09-24 13:19                       ` Johannes Weiner
2007-09-24 14:48                         ` Roland Winkler
2007-09-25 10:44                           ` Richard Stallman
2007-09-24 15:13                         ` Drew Adams
2007-09-25 10:43                       ` Richard Stallman
2007-09-17 22:31       ` Davis Herring
2007-09-18  0:53       ` Stefan Monnier
2007-09-23 21:55         ` Richard Stallman
2007-09-24  8:30           ` Stefan Monnier
2007-09-24 17:16           ` Davis Herring
2007-09-24 17:24             ` Drew Adams
2007-09-25 10:44             ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38233.128.165.123.18.1189460486.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --cc=Roland.Winkler@physik.uni-erlangen.de \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).