emacs-devel
[Top][All Lists]
Advanced

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

wrapper fn for message and minibuffer-message?


From: Drew Adams
Subject: wrapper fn for message and minibuffer-message?
Date: Tue, 4 Oct 2005 14:58:52 -0700

Ignore if already discussed or idea seems useless.

I have some commands that users can use either at top level or when in the
minibuffer. (In the latter case, they are bound to keys.)  I use the
following wrapper function, and I wonder if such a function might not be
useful generally, for defining Emacs commands that are likely to be (also)
bound in a minibuffer map.

Some toggle commands are examples of use cases - toggles that can take
effect while still inputting in the minibuffer.

(defun msg-maybe-in-minibuffer (string &rest args)
  "Display STRING with `message' or `minibuffer-message', as appropriate."
  (if (active-minibuffer-window)
      (minibuffer-message (format "  [%s]" string))
    (message string)))

No, this does not provide the generality of `message', which accepts a
format string and possibly other args to be formatted.  It might
nevertheless be useful.





reply via email to

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