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.



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to