forked from mirrors/org-mode
Better mechanism cor copying faces
This works much better to additional frames.
This commit is contained in:
parent
9d322790d4
commit
24be3cda29
|
@ -1,5 +1,8 @@
|
||||||
2009-09-22 Carsten Dominik <carsten.dominik@gmail.com>
|
2009-09-22 Carsten Dominik <carsten.dominik@gmail.com>
|
||||||
|
|
||||||
|
* org-faces.el (org-copy-face): New function. Use it to create
|
||||||
|
various faces formerly created by using `copy-face'.
|
||||||
|
|
||||||
* org-agenda.el (org-prepare-agenda): Don't officially mark this
|
* org-agenda.el (org-prepare-agenda): Don't officially mark this
|
||||||
window dedicated.
|
window dedicated.
|
||||||
(org-agenda-quit): Kill the frame containing the agenda window if
|
(org-agenda-quit): Kill the frame containing the agenda window if
|
||||||
|
|
|
@ -33,6 +33,18 @@
|
||||||
(require 'org-macs)
|
(require 'org-macs)
|
||||||
(require 'org-compat)
|
(require 'org-compat)
|
||||||
|
|
||||||
|
(defun org-copy-face (old-face new-face docstring &rest attributes)
|
||||||
|
(unless (facep new-face)
|
||||||
|
(if (fboundp 'set-face-attribute)
|
||||||
|
(progn
|
||||||
|
(make-face new-face)
|
||||||
|
(set-face-attribute new-face nil :inherit old-face)
|
||||||
|
(apply 'set-face-attribute new-face nil attributes)
|
||||||
|
(set-face-doc-string new-face docstring))
|
||||||
|
(copy-face old-face new-face)
|
||||||
|
(if (fboundp 'set-face-doc-string)
|
||||||
|
(set-face-doc-string new-face docstring)))))
|
||||||
|
|
||||||
(defgroup org-faces nil
|
(defgroup org-faces nil
|
||||||
"Faces in Org-mode."
|
"Faces in Org-mode."
|
||||||
:tag "Org Faces"
|
:tag "Org Faces"
|
||||||
|
@ -363,15 +375,12 @@ list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
|
||||||
"Face for checkboxes"
|
"Face for checkboxes"
|
||||||
:group 'org-faces)
|
:group 'org-faces)
|
||||||
|
|
||||||
(unless (facep 'org-checkbox-statistics-todo)
|
|
||||||
(copy-face 'org-todo 'org-checkbox-statistics-todo)
|
|
||||||
(set-face-doc-string 'org-checkbox-statistics-todo
|
|
||||||
"Face used for unfinished checkbox statistics."))
|
|
||||||
|
|
||||||
(unless (facep 'org-checkbox-statistics-done)
|
(org-copy-face 'org-todo 'org-checkbox-statistics-todo
|
||||||
(copy-face 'org-done 'org-checkbox-statistics-done)
|
"Face used for unfinished checkbox statistics.")
|
||||||
(set-face-doc-string 'org-checkbox-statistics-done
|
|
||||||
"Face used for finished checkbox statistics."))
|
(org-copy-face 'org-done 'org-checkbox-statistics-done
|
||||||
|
"Face used for finished checkbox statistics.")
|
||||||
|
|
||||||
(defcustom org-tag-faces nil
|
(defcustom org-tag-faces nil
|
||||||
"Faces for specific tags.
|
"Faces for specific tags.
|
||||||
|
@ -486,31 +495,21 @@ changes."
|
||||||
"Face used in agenda for captions and dates."
|
"Face used in agenda for captions and dates."
|
||||||
:group 'org-faces)
|
:group 'org-faces)
|
||||||
|
|
||||||
(unless (facep 'org-agenda-date)
|
(org-copy-face 'org-agenda-structure 'org-agenda-date
|
||||||
(copy-face 'org-agenda-structure 'org-agenda-date)
|
"Face used in agenda for normal days.")
|
||||||
(set-face-doc-string 'org-agenda-date
|
|
||||||
"Face used in agenda for normal days."))
|
|
||||||
|
|
||||||
(unless (facep 'org-agenda-date-today)
|
(org-copy-face 'org-agenda-date 'org-agenda-date-today
|
||||||
(copy-face 'org-agenda-date 'org-agenda-date-today)
|
"Face used in agenda for today."
|
||||||
(set-face-doc-string 'org-agenda-date-today
|
:weight 'bold :italic 't)
|
||||||
"Face used in agenda for today.")
|
|
||||||
(when (fboundp 'set-face-attribute)
|
|
||||||
(set-face-attribute 'org-agenda-date-today nil :weight 'bold :italic 't)))
|
|
||||||
|
|
||||||
(unless (facep 'org-agenda-clocking)
|
(org-copy-face 'secondary-selection 'org-agenda-clocking
|
||||||
(copy-face 'secondary-selection 'org-agenda-clocking)
|
"Face marking the current clock item in the agenda.")
|
||||||
(set-face-doc-string 'org-agenda-clocking
|
|
||||||
"Face marking the current clock item in the agenda."))
|
|
||||||
|
|
||||||
(unless (facep 'org-agenda-date-weekend)
|
(org-copy-face 'org-agenda-date 'org-agenda-date-weekend
|
||||||
(copy-face 'org-agenda-date 'org-agenda-date-weekend)
|
|
||||||
(set-face-doc-string 'org-agenda-date-weekend
|
|
||||||
"Face used in agenda for weekend days.
|
"Face used in agenda for weekend days.
|
||||||
See the variable `org-agenda-weekend-days' for a definition of which days
|
See the variable `org-agenda-weekend-days' for a definition of which days
|
||||||
belong to the weekend.")
|
belong to the weekend."
|
||||||
(when (fboundp 'set-face-attribute)
|
:weight 'bold)
|
||||||
(set-face-attribute 'org-agenda-date-weekend nil :weight 'bold)))
|
|
||||||
|
|
||||||
(defface org-scheduled
|
(defface org-scheduled
|
||||||
(org-compatible-face nil
|
(org-compatible-face nil
|
||||||
|
@ -628,10 +627,8 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc."
|
||||||
"Face used to highlight math latex and other special exporter stuff."
|
"Face used to highlight math latex and other special exporter stuff."
|
||||||
:group 'org-faces)
|
:group 'org-faces)
|
||||||
|
|
||||||
(unless (facep 'org-mode-line-clock)
|
(org-copy-face 'modeline 'org-mode-line-clock
|
||||||
(copy-face 'modeline 'org-mode-line-clock)
|
"Face used for clock display in mode line.")
|
||||||
(set-face-doc-string 'org-agenda-date
|
|
||||||
"Face used for clock display in mode line."))
|
|
||||||
|
|
||||||
(provide 'org-faces)
|
(provide 'org-faces)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue