diff options
| author | Stephen Berman | 2013-01-25 16:39:38 +0100 |
|---|---|---|
| committer | Stephen Berman | 2013-01-25 16:39:38 +0100 |
| commit | e0f6342fb3343ce70ab6fa6c4acbdc3d42eb618e (patch) | |
| tree | 156d582b8a31d36c858e6a432c85773ad39a023e | |
| parent | dda6bf799aff238bfcde5538d96f9b4c6d333ed4 (diff) | |
| download | emacs-e0f6342fb3343ce70ab6fa6c4acbdc3d42eb618e.tar.gz emacs-e0f6342fb3343ce70ab6fa6c4acbdc3d42eb618e.zip | |
* calendar/todos.el: Improve definitions and use of some faces.
(todos-top-priority): Use current definition of font-lock-constant-face.
(todos-diary-expired): Make default value contrast more with
default value of todos-date face.
(todos-nondiary, todos-category-string): New faces.
(todos-nondiary-face, todos-category-string-face): Corresponding
new variables.
(todos-done, todos-comment): Switch default values to go better
with default value of todos-date face.
(todos-done-sep): Change default value.
(todos-category-string-matcher-1)
(todos-category-string-matcher-2): Improve doc string.
(todos-font-lock-keywords): Use todos-nondiary-face and
todos-category-string-face.
(todos-done-separator): Propertize string with todos-done-sep face.
(todos-filtered-items-mode): Fix typo.
| -rw-r--r-- | lisp/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/calendar/todos.el | 151 |
2 files changed, 107 insertions, 63 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ed336ad5bf2..0543b8c3070 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2013-01-25 Stephen Berman <stephen.berman@gmx.net> | ||
| 2 | |||
| 3 | * calendar/todos.el: Improve definitions and use of some faces. | ||
| 4 | (todos-top-priority): Use current definition of font-lock-constant-face. | ||
| 5 | (todos-diary-expired): Make default value contrast more with | ||
| 6 | default value of todos-date face. | ||
| 7 | (todos-nondiary, todos-category-string): New faces. | ||
| 8 | (todos-nondiary-face, todos-category-string-face): Corresponding | ||
| 9 | new variables. | ||
| 10 | (todos-done, todos-comment): Switch default values to go better | ||
| 11 | with default value of todos-date face. | ||
| 12 | (todos-done-sep): Change default value. | ||
| 13 | (todos-category-string-matcher-1) | ||
| 14 | (todos-category-string-matcher-2): Improve doc string. | ||
| 15 | (todos-font-lock-keywords): Use todos-nondiary-face and | ||
| 16 | todos-category-string-face. | ||
| 17 | (todos-done-separator): Propertize string with todos-done-sep face. | ||
| 18 | (todos-filtered-items-mode): Fix typo. | ||
| 19 | |||
| 1 | 2013-01-23 Stephen Berman <stephen.berman@gmx.net> | 20 | 2013-01-23 Stephen Berman <stephen.berman@gmx.net> |
| 2 | 21 | ||
| 3 | * calendar/todos.el: Improve handling of saved top priorities items. | 22 | * calendar/todos.el: Improve handling of saved top priorities items. |
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el index 14cfdc59127..3a95b7d4b9d 100644 --- a/lisp/calendar/todos.el +++ b/lisp/calendar/todos.el | |||
| @@ -626,24 +626,17 @@ categories display according to priority." | |||
| 626 | :group 'todos-faces) | 626 | :group 'todos-faces) |
| 627 | 627 | ||
| 628 | (defface todos-top-priority | 628 | (defface todos-top-priority |
| 629 | ;; '((t :inherit font-lock-comment-face)) | 629 | ;; bold font-lock-comment-face |
| 630 | '((((class grayscale) (background light)) | 630 | '((default :weight bold) |
| 631 | :foreground "DimGray" :weight bold :slant italic) | 631 | (((class grayscale) (background light)) :foreground "DimGray" :slant italic) |
| 632 | (((class grayscale) (background dark)) | 632 | (((class grayscale) (background dark)) :foreground "LightGray" :slant italic) |
| 633 | :foreground "LightGray" :weight bold :slant italic) | 633 | (((class color) (min-colors 88) (background light)) :foreground "Firebrick") |
| 634 | (((class color) (min-colors 88) (background light)) | 634 | (((class color) (min-colors 88) (background dark)) :foreground "chocolate1") |
| 635 | :foreground "Firebrick" :weight bold) | 635 | (((class color) (min-colors 16) (background light)) :foreground "red") |
| 636 | (((class color) (min-colors 88) (background dark)) | 636 | (((class color) (min-colors 16) (background dark)) :foreground "red1") |
| 637 | :foreground "chocolate1" :weight bold) | 637 | (((class color) (min-colors 8) (background light)) :foreground "red") |
| 638 | (((class color) (min-colors 16) (background light)) | 638 | (((class color) (min-colors 8) (background dark)) :foreground "yellow") |
| 639 | :foreground "red" :weight bold) | 639 | (t :slant italic)) |
| 640 | (((class color) (min-colors 16) (background dark)) | ||
| 641 | :foreground "red1" :weight bold) | ||
| 642 | (((class color) (min-colors 8) (background light)) | ||
| 643 | :foreground "red" :weight bold) | ||
| 644 | (((class color) (min-colors 8) (background dark)) | ||
| 645 | :foreground "yellow" :weight bold) | ||
| 646 | (t :weight bold :slant italic)) | ||
| 647 | "Face for top priority Todos item numerical priority string. | 640 | "Face for top priority Todos item numerical priority string. |
| 648 | The item's priority number string has this face if the number is | 641 | The item's priority number string has this face if the number is |
| 649 | less than or equal the category's top priority setting." | 642 | less than or equal the category's top priority setting." |
| @@ -744,14 +737,19 @@ less than or equal the category's top priority setting." | |||
| 744 | :group 'todos-faces) | 737 | :group 'todos-faces) |
| 745 | 738 | ||
| 746 | (defface todos-diary-expired | 739 | (defface todos-diary-expired |
| 747 | ;; '((t :inherit font-lock-warning-face)) | 740 | ;; Doesn't contrast enough with todos-date (= diary) face. |
| 748 | '((((class color) | 741 | ;; ;; '((t :inherit warning)) |
| 749 | (min-colors 16)) | 742 | ;; '((default :weight bold) |
| 750 | (:weight bold :foreground "DarkOrange")) | 743 | ;; (((class color) (min-colors 16)) :foreground "DarkOrange") |
| 751 | (((class color)) | 744 | ;; (((class color)) :foreground "yellow")) |
| 752 | (:weight bold :foreground "yellow")) | 745 | ;; bold font-lock-function-name-face |
| 753 | (t | 746 | '((default :weight bold) |
| 754 | (:weight bold))) | 747 | (((class color) (min-colors 88) (background light)) :foreground "Blue1") |
| 748 | (((class color) (min-colors 88) (background dark)) :foreground "LightSkyBlue") | ||
| 749 | (((class color) (min-colors 16) (background light)) :foreground "Blue") | ||
| 750 | (((class color) (min-colors 16) (background dark)) :foreground "LightSkyBlue") | ||
| 751 | (((class color) (min-colors 8)) :foreground "blue") | ||
| 752 | (t :inverse-video t)) | ||
| 755 | "Face for expired dates of diary items." | 753 | "Face for expired dates of diary items." |
| 756 | :group 'todos-faces) | 754 | :group 'todos-faces) |
| 757 | (defvar todos-diary-expired-face 'todos-diary-expired) | 755 | (defvar todos-diary-expired-face 'todos-diary-expired) |
| @@ -768,7 +766,49 @@ less than or equal the category's top priority setting." | |||
| 768 | :group 'todos-faces) | 766 | :group 'todos-faces) |
| 769 | (defvar todos-time-face 'todos-time) | 767 | (defvar todos-time-face 'todos-time) |
| 770 | 768 | ||
| 769 | (defface todos-nondiary | ||
| 770 | ;; '((t :inherit font-lock-type-face)) | ||
| 771 | '((((class grayscale) (background light)) :foreground "Gray90" :weight bold) | ||
| 772 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) | ||
| 773 | (((class color) (min-colors 88) (background light)) :foreground "ForestGreen") | ||
| 774 | (((class color) (min-colors 88) (background dark)) :foreground "PaleGreen") | ||
| 775 | (((class color) (min-colors 16) (background light)) :foreground "ForestGreen") | ||
| 776 | (((class color) (min-colors 16) (background dark)) :foreground "PaleGreen") | ||
| 777 | (((class color) (min-colors 8)) :foreground "green") | ||
| 778 | (t :weight bold :underline t)) | ||
| 779 | "Face for non-diary markers around todo item date/time header." | ||
| 780 | :group 'todos-faces) | ||
| 781 | (defvar todos-nondiary-face 'todos-nondiary) | ||
| 782 | |||
| 783 | (defface todos-category-string | ||
| 784 | ;; '((t :inherit font-lock-type-face)) | ||
| 785 | '((((class grayscale) (background light)) :foreground "Gray90" :weight bold) | ||
| 786 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) | ||
| 787 | (((class color) (min-colors 88) (background light)) :foreground "ForestGreen") | ||
| 788 | (((class color) (min-colors 88) (background dark)) :foreground "PaleGreen") | ||
| 789 | (((class color) (min-colors 16) (background light)) :foreground "ForestGreen") | ||
| 790 | (((class color) (min-colors 16) (background dark)) :foreground "PaleGreen") | ||
| 791 | (((class color) (min-colors 8)) :foreground "green") | ||
| 792 | (t :weight bold :underline t)) | ||
| 793 | "Face for category file names in Todos Filtered Item." | ||
| 794 | :group 'todos-faces) | ||
| 795 | (defvar todos-category-string-face 'todos-category-string) | ||
| 796 | |||
| 771 | (defface todos-done | 797 | (defface todos-done |
| 798 | ;; '((t :inherit font-lock-keyword-face)) | ||
| 799 | '((((class grayscale) (background light)) :foreground "LightGray" :weight bold) | ||
| 800 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) | ||
| 801 | (((class color) (min-colors 88) (background light)) :foreground "Purple") | ||
| 802 | (((class color) (min-colors 88) (background dark)) :foreground "Cyan1") | ||
| 803 | (((class color) (min-colors 16) (background light)) :foreground "Purple") | ||
| 804 | (((class color) (min-colors 16) (background dark)) :foreground "Cyan") | ||
| 805 | (((class color) (min-colors 8)) :foreground "cyan" :weight bold) | ||
| 806 | (t :weight bold)) | ||
| 807 | "Face for done Todos item header string." | ||
| 808 | :group 'todos-faces) | ||
| 809 | (defvar todos-done-face 'todos-done) | ||
| 810 | |||
| 811 | (defface todos-comment | ||
| 772 | ;; '((t :inherit font-lock-comment-face)) | 812 | ;; '((t :inherit font-lock-comment-face)) |
| 773 | '((((class grayscale) (background light)) | 813 | '((((class grayscale) (background light)) |
| 774 | :foreground "DimGray" :weight bold :slant italic) | 814 | :foreground "DimGray" :weight bold :slant italic) |
| @@ -779,7 +819,6 @@ less than or equal the category's top priority setting." | |||
| 779 | (((class color) (min-colors 88) (background dark)) | 819 | (((class color) (min-colors 88) (background dark)) |
| 780 | :foreground "chocolate1") | 820 | :foreground "chocolate1") |
| 781 | (((class color) (min-colors 16) (background light)) | 821 | (((class color) (min-colors 16) (background light)) |
| 782 | ;; FIXME: this is the same as todos-date with default value of diary face | ||
| 783 | :foreground "red") | 822 | :foreground "red") |
| 784 | (((class color) (min-colors 16) (background dark)) | 823 | (((class color) (min-colors 16) (background dark)) |
| 785 | :foreground "red1") | 824 | :foreground "red1") |
| @@ -788,34 +827,20 @@ less than or equal the category's top priority setting." | |||
| 788 | (((class color) (min-colors 8) (background dark)) | 827 | (((class color) (min-colors 8) (background dark)) |
| 789 | :foreground "yellow") | 828 | :foreground "yellow") |
| 790 | (t :weight bold :slant italic)) | 829 | (t :weight bold :slant italic)) |
| 791 | "Face for done Todos item header string." | ||
| 792 | :group 'todos-faces) | ||
| 793 | (defvar todos-done-face 'todos-done) | ||
| 794 | |||
| 795 | (defface todos-comment | ||
| 796 | ;; '((t :inherit font-lock-keyword-face)) | ||
| 797 | '((((class grayscale) (background light)) :foreground "LightGray" :weight bold) | ||
| 798 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) | ||
| 799 | (((class color) (min-colors 88) (background light)) :foreground "Purple") | ||
| 800 | (((class color) (min-colors 88) (background dark)) :foreground "Cyan1") | ||
| 801 | (((class color) (min-colors 16) (background light)) :foreground "Purple") | ||
| 802 | (((class color) (min-colors 16) (background dark)) :foreground "Cyan") | ||
| 803 | (((class color) (min-colors 8)) :foreground "cyan" :weight bold) | ||
| 804 | (t :weight bold)) | ||
| 805 | "Face for comments appended to done Todos items." | 830 | "Face for comments appended to done Todos items." |
| 806 | :group 'todos-faces) | 831 | :group 'todos-faces) |
| 807 | (defvar todos-comment-face 'todos-comment) | 832 | (defvar todos-comment-face 'todos-comment) |
| 808 | 833 | ||
| 809 | (defface todos-done-sep | 834 | (defface todos-done-sep |
| 810 | ;; '((t :inherit font-lock-type-face)) | 835 | ;; '((t :inherit font-lock-builtin-face)) |
| 811 | '((((class grayscale) (background light)) :foreground "Gray90" :weight bold) | 836 | '((((class grayscale) (background light)) :foreground "LightGray" :weight bold) |
| 812 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) | 837 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) |
| 813 | (((class color) (min-colors 88) (background light)) :foreground "ForestGreen") | 838 | (((class color) (min-colors 88) (background light)) :foreground "dark slate blue") |
| 814 | (((class color) (min-colors 88) (background dark)) :foreground "PaleGreen") | 839 | (((class color) (min-colors 88) (background dark)) :foreground "LightSteelBlue") |
| 815 | (((class color) (min-colors 16) (background light)) :foreground "ForestGreen") | 840 | (((class color) (min-colors 16) (background light)) :foreground "Orchid") |
| 816 | (((class color) (min-colors 16) (background dark)) :foreground "PaleGreen") | 841 | (((class color) (min-colors 16) (background dark)) :foreground "LightSteelBlue") |
| 817 | (((class color) (min-colors 8)) :foreground "green") | 842 | (((class color) (min-colors 8)) :foreground "blue" :weight bold) |
| 818 | (t :weight bold :underline t)) | 843 | (t :weight bold)) |
| 819 | "Face for separator string bewteen done and not done Todos items." | 844 | "Face for separator string bewteen done and not done Todos items." |
| 820 | :group 'todos-faces) | 845 | :group 'todos-faces) |
| 821 | (defvar todos-done-sep-face 'todos-done-sep) | 846 | (defvar todos-done-sep-face 'todos-done-sep) |
| @@ -880,8 +905,8 @@ less than or equal the category's top priority setting." | |||
| 880 | 905 | ||
| 881 | (defun todos-category-string-matcher-1 (lim) | 906 | (defun todos-category-string-matcher-1 (lim) |
| 882 | "Search for Todos category name within LIM for font-locking. | 907 | "Search for Todos category name within LIM for font-locking. |
| 883 | This is for fontifying category names appearing in Todos filter | 908 | This is for fontifying category and file names appearing in Todos |
| 884 | mode following done items." | 909 | Filtered Items mode following done items." |
| 885 | (if (eq major-mode 'todos-filtered-items-mode) | 910 | (if (eq major-mode 'todos-filtered-items-mode) |
| 886 | (re-search-forward (concat todos-done-string-start todos-date-pattern | 911 | (re-search-forward (concat todos-done-string-start todos-date-pattern |
| 887 | "\\(?: " diary-time-regexp | 912 | "\\(?: " diary-time-regexp |
| @@ -893,8 +918,8 @@ mode following done items." | |||
| 893 | 918 | ||
| 894 | (defun todos-category-string-matcher-2 (lim) | 919 | (defun todos-category-string-matcher-2 (lim) |
| 895 | "Search for Todos category name within LIM for font-locking. | 920 | "Search for Todos category name within LIM for font-locking. |
| 896 | This is for fontifying category names appearing in Todos filter | 921 | This is for fontifying category and file names appearing in Todos |
| 897 | mode following todo (not done) items." | 922 | Filtered Items mode following todo (not done) items." |
| 898 | (if (eq major-mode 'todos-filtered-items-mode) | 923 | (if (eq major-mode 'todos-filtered-items-mode) |
| 899 | (re-search-forward (concat todos-date-string-start todos-date-pattern | 924 | (re-search-forward (concat todos-date-string-start todos-date-pattern |
| 900 | "\\(?: " diary-time-regexp "\\)?\\(?:" | 925 | "\\(?: " diary-time-regexp "\\)?\\(?:" |
| @@ -904,17 +929,16 @@ mode following todo (not done) items." | |||
| 904 | 929 | ||
| 905 | (defvar todos-font-lock-keywords | 930 | (defvar todos-font-lock-keywords |
| 906 | (list | 931 | (list |
| 907 | '(todos-nondiary-marker-matcher 1 todos-done-sep-face t) | 932 | '(todos-nondiary-marker-matcher 1 todos-nondiary-face t) |
| 908 | '(todos-nondiary-marker-matcher 2 todos-done-sep-face t) | 933 | '(todos-nondiary-marker-matcher 2 todos-nondiary-face t) |
| 909 | ;; This is the face used by diary-lib.el. | 934 | ;; diary-lib.el uses font-lock-constant-face for diary-nonmarking-symbol. |
| 910 | '(todos-diary-nonmarking-matcher 1 font-lock-constant-face t) | 935 | '(todos-diary-nonmarking-matcher 1 font-lock-constant-face t) |
| 911 | '(todos-date-string-matcher 1 todos-date-face t) | 936 | '(todos-date-string-matcher 1 todos-date-face t) |
| 912 | '(todos-time-string-matcher 1 todos-time-face t) | 937 | '(todos-time-string-matcher 1 todos-time-face t) |
| 913 | '(todos-done-string-matcher 0 todos-done-face t) | 938 | '(todos-done-string-matcher 0 todos-done-face t) |
| 914 | '(todos-comment-string-matcher 1 todos-comment-face t) | 939 | '(todos-comment-string-matcher 1 todos-comment-face t) |
| 915 | ;; '(todos-category-string-matcher 1 todos-done-sep-face t) | 940 | '(todos-category-string-matcher-1 1 todos-category-string-face t t) |
| 916 | '(todos-category-string-matcher-1 1 todos-done-sep-face t t) | 941 | '(todos-category-string-matcher-2 1 todos-category-string-face t t) |
| 917 | '(todos-category-string-matcher-2 1 todos-done-sep-face t t) | ||
| 918 | '(todos-diary-expired-matcher 1 todos-diary-expired-face t) | 942 | '(todos-diary-expired-matcher 1 todos-diary-expired-face t) |
| 919 | '(todos-diary-expired-matcher 2 todos-diary-expired-face t t) | 943 | '(todos-diary-expired-matcher 2 todos-diary-expired-face t t) |
| 920 | ) | 944 | ) |
| @@ -1127,9 +1151,10 @@ number as its value." | |||
| 1127 | (defun todos-done-separator () | 1151 | (defun todos-done-separator () |
| 1128 | "Return string used as value of variable `todos-done-separator'." | 1152 | "Return string used as value of variable `todos-done-separator'." |
| 1129 | (let ((sep todos-done-separator-string)) | 1153 | (let ((sep todos-done-separator-string)) |
| 1130 | (if (= 1 (length sep)) | 1154 | (propertize (if (= 1 (length sep)) |
| 1131 | (make-string (window-width) (string-to-char sep)) | 1155 | (make-string (window-width) (string-to-char sep)) |
| 1132 | todos-done-separator-string))) | 1156 | todos-done-separator-string) |
| 1157 | 'face 'todos-done-sep))) | ||
| 1133 | 1158 | ||
| 1134 | (defvar todos-done-separator (todos-done-separator) | 1159 | (defvar todos-done-separator (todos-done-separator) |
| 1135 | "String used to visually separate done from not done items. | 1160 | "String used to visually separate done from not done items. |
| @@ -2998,7 +3023,7 @@ which is the value of the user option | |||
| 2998 | \\{todos-categories-mode-map}" | 3023 | \\{todos-categories-mode-map}" |
| 2999 | (todos-mode-external-set)) | 3024 | (todos-mode-external-set)) |
| 3000 | 3025 | ||
| 3001 | (put 'todos-filter-mode 'mode-class 'special) | 3026 | (put 'todos-filtered-items-mode 'mode-class 'special) |
| 3002 | 3027 | ||
| 3003 | (define-derived-mode todos-filtered-items-mode special-mode "Todos-Fltr" | 3028 | (define-derived-mode todos-filtered-items-mode special-mode "Todos-Fltr" |
| 3004 | "Mode for displaying and reprioritizing top priority Todos. | 3029 | "Mode for displaying and reprioritizing top priority Todos. |