aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-06-14 11:58:22 -0700
committerPaul Eggert2011-06-14 11:58:22 -0700
commite8f2a944716884ba72b9ef3a49db2d5bca428ac9 (patch)
treeb29969e69560533e46d173b27311c24248f440c1
parentf66c7cf8f794d6f7fd9ccb8794ffc519e4e89795 (diff)
parentc5dd5a516c9f0f4b622452c42e34e95ca2e2fae5 (diff)
downloademacs-e8f2a944716884ba72b9ef3a49db2d5bca428ac9.tar.gz
emacs-e8f2a944716884ba72b9ef3a49db2d5bca428ac9.zip
Merge from trunk.
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/themes/dichromacy-theme.el127
-rw-r--r--etc/themes/light-blue-theme.el2
-rw-r--r--etc/themes/misterioso-theme.el2
-rw-r--r--etc/themes/tango-dark-theme.el2
-rw-r--r--etc/themes/tango-theme.el2
-rw-r--r--etc/themes/tsdh-dark-theme.el3
-rw-r--r--etc/themes/tsdh-light-theme.el3
-rw-r--r--etc/themes/wheatgrass-theme.el2
-rw-r--r--etc/themes/wombat-theme.el2
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/cus-theme.el73
12 files changed, 198 insertions, 30 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 78c19326afe..109124af4ee 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12011-06-14 Chong Yidong <cyd@stupidchicken.com>
2
3 * themes/dichromacy-theme.el: New theme.
4
12011-06-07 Paul Eggert <eggert@cs.ucla.edu> 52011-06-07 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * NEWS: Mention new configure option --with-wide-int. 7 * NEWS: Mention new configure option --with-wide-int.
diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el
new file mode 100644
index 00000000000..0105080ab08
--- /dev/null
+++ b/etc/themes/dichromacy-theme.el
@@ -0,0 +1,127 @@
1;;; dichromacy-theme.el --- color theme suitable for color-blind users
2
3;; Copyright (C) 2011 Free Software Foundation, Inc.
4
5;; Author: Chong Yidong <cyd@stupidchicken>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Code:
23
24(deftheme dichromacy
25 "Face colors suitable for red/green color-blind users.
26The color palette is from B. Wong, Nature Methods 8, 441 (2011).
27It is intended to provide good variability while being easily
28differentiated by individuals with protanopia or deuteranopia.
29
30Basic, Font Lock, Isearch, Gnus, Message, Flyspell, and
31Ansi-Color faces are included.")
32
33(let ((class '((class color) (min-colors 89)))
34 (orange "#e69f00")
35 (skyblue "#56b4e9")
36 (bluegreen "#009e73")
37 (yellow "#f8ec59")
38 (blue "#0072b2")
39 (vermillion "#d55e00")
40 (redpurple "#cc79a7")
41 (bluegray "#848ea9"))
42 (custom-theme-set-faces
43 'dichromacy
44 `(default ((,class (:foreground "black" :background "white"))))
45 `(cursor ((,class (:foreground "white" :background "black"))))
46 ;; Highlighting faces
47 `(fringe ((,class (:background "#f7f7f7"))))
48 `(highlight ((,class (:foreground ,blue :background "#e5e5e5"))))
49 `(region ((,class (:foreground unspecified :background ,yellow))))
50 `(secondary-selection ((,class (:background "#e5e5e5"))))
51 `(isearch ((,class (:foreground "white" :background ,vermillion))))
52 `(lazy-highlight ((,class (:foreground "white" :background ,redpurple))))
53 `(trailing-whitespace ((,class (:background ,vermillion))))
54 ;; Mode line faces
55 `(mode-line ((,class (:box (:line-width -1 :style released-button)
56 :background "#e5e5e5" :foreground "black"))))
57 `(mode-line-inactive ((,class (:box (:line-width -1 :style released-button)
58 :background "#b0b0b0"
59 :foreground "black"))))
60 ;; Escape and prompt faces
61 `(minibuffer-prompt ((,class (:weight bold :foreground ,blue))))
62 `(escape-glyph ((,class (:foreground ,vermillion))))
63 ;; Font lock faces
64 `(font-lock-builtin-face ((,class (:foreground ,blue))))
65 `(font-lock-comment-face ((,class (:slant italic :foreground ,bluegreen))))
66 `(font-lock-constant-face ((,class (:weight bold :foreground ,vermillion))))
67 `(font-lock-function-name-face ((,class (:foreground ,vermillion))))
68 `(font-lock-keyword-face ((,class (:weight bold :foreground ,skyblue))))
69 `(font-lock-string-face ((,class (:foreground ,bluegray))))
70 `(font-lock-type-face ((,class (:weight bold :foreground ,blue))))
71 `(font-lock-variable-name-face ((,class (:weight bold :foreground ,orange))))
72 `(font-lock-warning-face ((,class (:weight bold :slant italic
73 :foreground ,vermillion))))
74 ;; Button and link faces
75 `(button ((,class (:underline t :foreground ,blue))))
76 `(link ((,class (:underline t :foreground ,blue))))
77 `(link-visited ((,class (:underline t :foreground ,redpurple))))
78 ;; Gnus faces
79 `(gnus-group-news-1 ((,class (:weight bold :foreground ,vermillion))))
80 `(gnus-group-news-1-low ((,class (:foreground ,vermillion))))
81 `(gnus-group-news-2 ((,class (:weight bold :foreground ,orange))))
82 `(gnus-group-news-2-low ((,class (:foreground ,orange))))
83 `(gnus-group-news-3 ((,class (:weight bold :foreground ,skyblue))))
84 `(gnus-group-news-3-low ((,class (:foreground ,skyblue))))
85 `(gnus-group-news-4 ((,class (:weight bold :foreground ,redpurple))))
86 `(gnus-group-news-4-low ((,class (:foreground ,redpurple))))
87 `(gnus-group-news-5 ((,class (:weight bold :foreground ,blue))))
88 `(gnus-group-news-5-low ((,class (:foreground ,blue))))
89 `(gnus-group-news-low ((,class (:foreground ,bluegreen))))
90 `(gnus-group-mail-1 ((,class (:weight bold :foreground ,vermillion))))
91 `(gnus-group-mail-1-low ((,class (:foreground ,vermillion))))
92 `(gnus-group-mail-2 ((,class (:weight bold :foreground ,orange))))
93 `(gnus-group-mail-2-low ((,class (:foreground ,orange))))
94 `(gnus-group-mail-3 ((,class (:weight bold :foreground ,skyblue))))
95 `(gnus-group-mail-3-low ((,class (:foreground ,skyblue))))
96 `(gnus-group-mail-low ((,class (:foreground ,bluegreen))))
97 `(gnus-header-content ((,class (:foreground ,redpurple))))
98 `(gnus-header-from ((,class (:weight bold :foreground ,blue))))
99 `(gnus-header-subject ((,class (:foreground ,orange))))
100 `(gnus-header-name ((,class (:foreground ,skyblue))))
101 `(gnus-header-newsgroups ((,class (:foreground ,vermillion))))
102 ;; Message faces
103 `(message-header-name ((,class (:foreground ,skyblue))))
104 `(message-header-cc ((,class (:foreground ,vermillion))))
105 `(message-header-other ((,class (:foreground ,bluegreen))))
106 `(message-header-subject ((,class (:foreground ,orange))))
107 `(message-header-to ((,class (:weight bold :foreground ,blue))))
108 `(message-cited-text ((,class (:slant italic :foreground ,bluegreen))))
109 `(message-separator ((,class (:weight bold :foreground ,redpurple))))
110 ;; Flyspell
111 `(flyspell-duplicate ((,class (:weight unspecified :foreground unspecified
112 :slant unspecified :underline ,orange))))
113 `(flyspell-incorrect ((,class (:weight unspecified :foreground unspecified
114 :slant unspecified :underline ,redpurple)))))
115
116 (custom-theme-set-variables
117 'dichromacy
118 `(ansi-color-names-vector ["black" ,vermillion ,bluegreen ,yellow
119 ,blue ,redpurple ,skyblue "white"])))
120
121(provide-theme 'dichromacy)
122
123;; Local Variables:
124;; no-byte-compile: t
125;; End:
126
127;;; dichromacy-theme.el ends here
diff --git a/etc/themes/light-blue-theme.el b/etc/themes/light-blue-theme.el
index 60f9fa8dc9d..98c74b268af 100644
--- a/etc/themes/light-blue-theme.el
+++ b/etc/themes/light-blue-theme.el
@@ -26,7 +26,7 @@
26;;; Code: 26;;; Code:
27 27
28(deftheme light-blue 28(deftheme light-blue
29 "Theme with a light blue backgound.") 29 "Face colors utilizing a light blue backgound.")
30 30
31(let ((class '((class color) (min-colors 89)))) 31(let ((class '((class color) (min-colors 89))))
32 (custom-theme-set-faces 32 (custom-theme-set-faces
diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el
index 864d31d9b09..ab4b2bc6191 100644
--- a/etc/themes/misterioso-theme.el
+++ b/etc/themes/misterioso-theme.el
@@ -22,7 +22,7 @@
22;;; Code: 22;;; Code:
23 23
24(deftheme misterioso 24(deftheme misterioso
25 "Theme for faces, using light colors on a dark gray background.") 25 "Predominantly blue/cyan faces on a dark cyan background.")
26 26
27(let ((class '((class color) (min-colors 89)))) 27(let ((class '((class color) (min-colors 89))))
28 28
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index a5731ab7d7d..b5621d10320 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -28,7 +28,7 @@
28;;; Code: 28;;; Code:
29 29
30(deftheme tango-dark 30(deftheme tango-dark
31 "Theme for faces, based on the Tango palette with a dark background. 31 "Face colors using the Tango palette (dark background).
32Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell, 32Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
33Semantic, and Ansi-Color faces are included.") 33Semantic, and Ansi-Color faces are included.")
34 34
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index 7be50a17f5f..c58e0036353 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -28,7 +28,7 @@
28;;; Code: 28;;; Code:
29 29
30(deftheme tango 30(deftheme tango
31 "Theme for faces, based on the Tango palette with a light background. 31 "Face colors using the Tango palette (light background).
32Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell, 32Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
33Semantic, and Ansi-Color faces are included.") 33Semantic, and Ansi-Color faces are included.")
34 34
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index b4fe0b59237..aaa43435ddf 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -20,7 +20,8 @@
20;;; Code: 20;;; Code:
21 21
22(deftheme tsdh-dark 22(deftheme tsdh-dark
23 "Theme with dark background used and created by Tassilo Horn.") 23 "Minor tweaks to the Emacs dark-background defaults.
24Used and created by Tassilo Horn.")
24 25
25(custom-theme-set-faces 26(custom-theme-set-faces
26 'tsdh-dark 27 'tsdh-dark
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index 4eda7a4b7c3..e7a2bafb03e 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -20,7 +20,8 @@
20;;; Code: 20;;; Code:
21 21
22(deftheme tsdh-light 22(deftheme tsdh-light
23 "Black on white theme used and created by Tassilo Horn.") 23 "Minor tweaks to the Emacs white-background defaults.
24Used and created by Tassilo Horn.")
24 25
25(custom-theme-set-faces 26(custom-theme-set-faces
26 'tsdh-light 27 'tsdh-light
diff --git a/etc/themes/wheatgrass-theme.el b/etc/themes/wheatgrass-theme.el
index 7fd241c5057..3a08bb63d96 100644
--- a/etc/themes/wheatgrass-theme.el
+++ b/etc/themes/wheatgrass-theme.el
@@ -20,7 +20,7 @@
20;;; Code: 20;;; Code:
21 21
22(deftheme wheatgrass 22(deftheme wheatgrass
23 "A high-contrast theme with a black background. 23 "High-contrast green/blue/brown faces on a black background.
24Basic, Font Lock, Isearch, Gnus, and Message faces are included. 24Basic, Font Lock, Isearch, Gnus, and Message faces are included.
25The default face foreground is wheat, with other faces in shades 25The default face foreground is wheat, with other faces in shades
26of green, brown, and blue.") 26of green, brown, and blue.")
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
index 6a16b52ee24..2aa64f894bf 100644
--- a/etc/themes/wombat-theme.el
+++ b/etc/themes/wombat-theme.el
@@ -22,7 +22,7 @@
22;;; Code: 22;;; Code:
23 23
24(deftheme wombat 24(deftheme wombat
25 "Theme for faces, using easy-on-the eyes colors on a dark gray background. 25 "Medium-contrast faces with a dark gray background.
26Adapted, with permission, from a Vim color scheme by Lars H. Nielsen. 26Adapted, with permission, from a Vim color scheme by Lars H. Nielsen.
27Basic, Font Lock, Isearch, Gnus, Message, and Ansi-Color faces 27Basic, Font Lock, Isearch, Gnus, Message, and Ansi-Color faces
28are included.") 28are included.")
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7dac139c295..2cf968505af 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-06-14 Chong Yidong <cyd@stupidchicken.com>
2
3 * cus-theme.el (describe-theme-1): Use custom-theme-p.
4 (custom-theme-summary): New function.
5 (customize-themes): Use it.
6
12011-06-13 Glenn Morris <rgm@gnu.org> 72011-06-13 Glenn Morris <rgm@gnu.org>
2 8
3 * cus-dep.el (custom-make-dependencies): Use up command-line-args-left. 9 * cus-dep.el (custom-make-dependencies): Use up command-line-args-left.
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 86fb43be72a..7f926c85e56 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -483,25 +483,24 @@ It includes all faces in list FACES."
483 'help-theme-def fn) 483 'help-theme-def fn)
484 (princ "'")) 484 (princ "'"))
485 (princ ".\n") 485 (princ ".\n")
486 (if (not (memq theme custom-known-themes)) 486 (if (custom-theme-p theme)
487 (progn 487 (progn
488 (princ "It is not loaded.") 488 (if (custom-theme-enabled-p theme)
489 ;; Attempt to grab the theme documentation 489 (princ "It is loaded and enabled.")
490 (when fn 490 (princ "It is loaded but disabled."))
491 (with-temp-buffer 491 (setq doc (get theme 'theme-documentation)))
492 (insert-file-contents fn) 492 (princ "It is not loaded.")
493 (let ((sexp (let ((read-circle nil)) 493 ;; Attempt to grab the theme documentation
494 (condition-case nil 494 (when fn
495 (read (current-buffer)) 495 (with-temp-buffer
496 (end-of-file nil))))) 496 (insert-file-contents fn)
497 (and sexp (listp sexp) 497 (let ((sexp (let ((read-circle nil))
498 (eq (car sexp) 'deftheme) 498 (condition-case nil
499 (setq doc (nth 2 sexp))))))) 499 (read (current-buffer))
500 (if (custom-theme-enabled-p theme) 500 (end-of-file nil)))))
501 (princ "It is loaded and enabled.") 501 (and sexp (listp sexp)
502 (princ "It is loaded but disabled.")) 502 (eq (car sexp) 'deftheme)
503 (setq doc (get theme 'theme-documentation))) 503 (setq doc (nth 2 sexp)))))))
504
505 (princ "\n\nDocumentation:\n") 504 (princ "\n\nDocumentation:\n")
506 (princ (if (stringp doc) 505 (princ (if (stringp doc)
507 doc 506 doc
@@ -605,26 +604,56 @@ Theme files are named *-theme.el in `"))
605 (widget-create 'checkbox 604 (widget-create 'checkbox
606 :value custom-theme-allow-multiple-selections 605 :value custom-theme-allow-multiple-selections
607 :action 'custom-theme-selections-toggle) 606 :action 'custom-theme-selections-toggle)
608 (widget-insert (propertize " Allow more than one theme at a time" 607 (widget-insert (propertize " Select more than one theme at a time"
609 'face '(variable-pitch (:height 0.9)))) 608 'face '(variable-pitch (:height 0.9))))
610 609
611 (widget-insert "\n\nAvailable Custom Themes:\n") 610 (widget-insert "\n\nAvailable Custom Themes:\n")
612 (let (widget) 611 (let ((help-echo "mouse-2: Enable this theme for this session")
612 widget)
613 (dolist (theme (custom-available-themes)) 613 (dolist (theme (custom-available-themes))
614 (setq widget (widget-create 'checkbox 614 (setq widget (widget-create 'checkbox
615 :value (custom-theme-enabled-p theme) 615 :value (custom-theme-enabled-p theme)
616 :theme-name theme 616 :theme-name theme
617 :help-echo help-echo
617 :action 'custom-theme-checkbox-toggle)) 618 :action 'custom-theme-checkbox-toggle))
618 (push (cons theme widget) custom--listed-themes) 619 (push (cons theme widget) custom--listed-themes)
619 (widget-create-child-and-convert widget 'push-button 620 (widget-create-child-and-convert widget 'push-button
620 :button-face-get 'ignore 621 :button-face-get 'ignore
621 :mouse-face-get 'ignore 622 :mouse-face-get 'ignore
622 :value (format " %s" theme) 623 :value (format " %s" theme)
623 :action 'widget-parent-action) 624 :action 'widget-parent-action
624 (widget-insert ?\n))) 625 :help-echo help-echo)
626 (widget-insert " -- "
627 (propertize (custom-theme-summary theme)
628 'face 'shadow)
629 ?\n)))
625 (goto-char (point-min)) 630 (goto-char (point-min))
626 (widget-setup)) 631 (widget-setup))
627 632
633(defun custom-theme-summary (theme)
634 "Return the summary line of THEME."
635 (let (doc)
636 (if (custom-theme-p theme)
637 (setq doc (get theme 'theme-documentation))
638 (let ((fn (locate-file (concat (symbol-name theme) "-theme.el")
639 (custom-theme--load-path)
640 '("" "c"))))
641 (when fn
642 (with-temp-buffer
643 (insert-file-contents fn)
644 (let ((sexp (let ((read-circle nil))
645 (condition-case nil
646 (read (current-buffer))
647 (end-of-file nil)))))
648 (and sexp (listp sexp)
649 (eq (car sexp) 'deftheme)
650 (setq doc (nth 2 sexp))))))))
651 (cond ((null doc)
652 "(no documentation available)")
653 ((string-match ".*" doc)
654 (match-string 0 doc))
655 (t doc))))
656
628(defun custom-theme-checkbox-toggle (widget &optional event) 657(defun custom-theme-checkbox-toggle (widget &optional event)
629 (let ((this-theme (widget-get widget :theme-name))) 658 (let ((this-theme (widget-get widget :theme-name)))
630 (if (widget-value widget) 659 (if (widget-value widget)