emacsbackground-colorminibuffer

Change the background color of the minibuffer when input is needed


Would it be possible to change the background color of the minibuffer when it's expecting user activity? For example when a function needs a parameter or when a function name is incomplete or when you started entering "C-x" and more keys are needed etc.

I'm thinking of something like this: http://emacswiki.org/emacs/Dedicated_Minibuffer_Frame (see "Minibuffer Background Color Indicates User Activity", with lots of screenshots)

Except that the above only works when the minibuffer is in its own frame.

I'd like to have it work when the minibuffer is a "regular" minibuffer, with other buffer(s) in the same frame.

My elisp is not strong enough yet to hack a solution to this myself so any input is very welcome.

EDIT

I can change the entire buffer's background doing the following:

(add-hook 'minibuffer-setup-hook 
  (function (lambda ()
              (set-background-color "black"))))

I don't know if it's easy to change only the minibuffer's background using some "hack".

I also don't know how to change back to the previous color. I'm not sure what's the correct way to do this.

If I can't change only the mini-buffer's background then changing the entire background is ok.


Solution

  • You can simply try to set face-remap-alist via minibuffer-setup-hook. Something like:

    (add-hook 'minibuffer-setup-hook
              (lambda ()
                (make-local-variable 'face-remapping-alist)
                (add-to-list 'face-remapping-alist '(default (:background "green")))))