Next: , Previous: , Up: Customisation  

Q3.3.5: How can one change the modeline color based on the mode used?

You can use something like the following:

(add-hook 'lisp-mode-hook
          (lambda ()
            (set-face-background 'modeline "red" (current-buffer))))

Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline colors change from the default set in your init.el. The change will only be made in the buffer you just entered (which contains the Lisp file you are editing) and will not affect the modeline colors anywhere else.


There are additional modeline faces, modeline-buffer-id, modeline-mousable, and modeline-mousable-minor-mode, which you may want to customize.