How to override override modeline customization from org-faces.el?

730 Views Asked by At

org-faces.el contains this code

(org-copy-face 'mode-line 'org-mode-line-clock
  "Face used for clock display in mode line.")

;; ...snip...

(provide 'org-faces)

;;; org-faces.el ends here

Which makes the right side of my modeline (the org clock display) have the same face as 'mode-line. Using my .emacs I'd like to change this behavior so that the org clock display uses the same face as 'mode-line-inactive.

I tried adding this to .emacs:

(require 'org-faces) ;;necessary?
(org-copy-face 'mode-line-inactive 'org-mode-line-clock
  "Face used for clock display in mode line."
  :background "blue")
(provide 'org-faces) ;;necessary?

but the modeline is unchanged after evaluating .emacs. Where am I going wrong? I'm pretty new to Lisp. Thanks for any help.

2

There are 2 best solutions below

2
On

You should redefine the face, as I do for "org-todo":

(set-face-attribute 'org-todo nil
                    :weight 'bold :box '(:line-width 1 :color "#D8ABA7")
                    :foreground "#D8ABA7" :background "#FFE6E4")

You may (or must, maybe, depending on where you place the above lines) leave the requiring of org-faces, but clearly not the provide line.

Alternatively, use a color theme that improves Org's use (such as my Emacs Leuven theme, see https://github.com/fniessen/emacs-leuven-theme), eventually customizing it to suit your taste.

0
On

This seems to work:

(eval-after-load "org-faces"
  '(set-face-attribute 'org-mode-line-clock nil
                       :inherit nil))

That is, make the org-mode-line-clock no longer inherit attributes from the mode-line face. It seems like it gets the attributes from mode-line or mode-line-inactive as appropriate, when displayed in the mode line.