3

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.

legoscia
  • 39,593
  • 22
  • 116
  • 167
Brian Wood
  • 657
  • 7
  • 13

2 Answers2

1

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.

fniessen
  • 4,408
  • 19
  • 18
  • 1
    Thank you very much for the reply. [This screenshot](https://dl.dropboxusercontent.com/u/7713778/org-mode-line-clock.png) shows my problem. I'm using set-face-attribute in .emacs to color the active modeline green. The result of that is that the org clock on the **inactive** modelines are also green. I want all the org clocks to be the same color as the inactive mode line. Is changing the org-todo face the right path? Is that related to the org clock in the modeline? Adding this code to .emacs with and requiring org-faces immediately before or after it, doesn't change anything. – Brian Wood Jan 09 '14 at 17:24
  • OK, now I think I understand your question: you want o-m-line-clock to be gray (as mode-line-inactive) when the window is inactive, and the same face to be green (as mode-line-active) when the window is active, right? In that case, I don't have a solution -- I have the same problem. And I don't think it's possible in current Emacs (like you still can't have different backgrounds per mode, for example). – fniessen Jan 10 '14 at 12:28
1

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.

legoscia
  • 39,593
  • 22
  • 116
  • 167