aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2005-09-04 18:00:43 +0000
committerChong Yidong2005-09-04 18:00:43 +0000
commit87d737aed0986cbe49a9d4ff8253c1ebbe7880d3 (patch)
treea6bdd33a8028962faa5321ec009aa1ad4a7ff4b0
parentd7ea8b71aa7b7bc119c662556c564258aadb12de (diff)
downloademacs-87d737aed0986cbe49a9d4ff8253c1ebbe7880d3.tar.gz
emacs-87d737aed0986cbe49a9d4ff8253c1ebbe7880d3.zip
*** empty log message ***
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/custom.el27
2 files changed, 27 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1bcdf7628b4..1782616a1c9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12005-09-04 Chong Yidong <cyd@stupidchicken.com>
2
3 * custom.el (load-theme): Renamed from require-theme.
4 Add interactive spec.
5 (enable-theme): Renamed from custom-enable-theme.
6 Add interactive spec.
7 (disable-theme): Renamed from custom-disable-theme.
8 Add interactive spec.
9 (custom-make-theme-feature): Doc fix.
10 (custom-theme-directory): Doc fix.
11 (provide-theme): Call enable-theme.
12
12005-09-02 Dan Nicolaescu <dann@ics.uci.edu> 132005-09-02 Dan Nicolaescu <dann@ics.uci.edu>
2 14
3 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to 15 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
diff --git a/lisp/custom.el b/lisp/custom.el
index 0831535f181..c4eae52751b 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -953,7 +953,7 @@ into `features'.
953 953
954This allows for a file-name convention for autoloading themes: 954This allows for a file-name convention for autoloading themes:
955Every theme X has a property `provide-theme' whose value is \"X-theme\". 955Every theme X has a property `provide-theme' whose value is \"X-theme\".
956\(require-theme X) then attempts to load the file `X-theme.el'." 956\(load-theme X) then attempts to load the file `X-theme.el'."
957 (intern (concat (symbol-name theme) "-theme"))) 957 (intern (concat (symbol-name theme) "-theme")))
958 958
959;;; Loading themes. 959;;; Loading themes.
@@ -996,7 +996,7 @@ Every theme X has a property `provide-theme' whose value is \"X-theme\".
996 "~/_emacs.d/" 996 "~/_emacs.d/"
997 "~/.emacs.d/") 997 "~/.emacs.d/")
998 "Directory in which Custom theme files should be written. 998 "Directory in which Custom theme files should be written.
999`require-theme' searches this directory in addition to load-path. 999`load-theme' searches this directory in addition to load-path.
1000The command `customize-create-theme' writes the files it produces 1000The command `customize-create-theme' writes the files it produces
1001into this directory." 1001into this directory."
1002 :type 'string 1002 :type 'string
@@ -1031,11 +1031,11 @@ by `custom-make-theme-feature'."
1031 ;; `user' must always be the highest-precedence enabled theme. 1031 ;; `user' must always be the highest-precedence enabled theme.
1032 ;; Make that remain true. (This has the effect of making user settings 1032 ;; Make that remain true. (This has the effect of making user settings
1033 ;; override the ones just loaded, too.) 1033 ;; override the ones just loaded, too.)
1034 (custom-enable-theme 'user)) 1034 (enable-theme 'user))
1035 1035
1036(defun require-theme (theme) 1036(defun load-theme (theme)
1037 "Try to load a theme's settings from its file. 1037 "Try to load a theme's settings from its file.
1038This also enables the theme; use `custom-disable-theme' to disable it." 1038This also enables the theme; use `disable-theme' to disable it."
1039 1039
1040 ;; THEME's feature is stored in THEME's `theme-feature' property. 1040 ;; THEME's feature is stored in THEME's `theme-feature' property.
1041 ;; Usually the `theme-feature' property contains a symbol created 1041 ;; Usually the `theme-feature' property contains a symbol created
@@ -1043,6 +1043,7 @@ This also enables the theme; use `custom-disable-theme' to disable it."
1043 1043
1044 ;; Note we do no check for validity of the theme here. 1044 ;; Note we do no check for validity of the theme here.
1045 ;; This allows to pull in themes by a file-name convention 1045 ;; This allows to pull in themes by a file-name convention
1046 (interactive "SCustom theme name: ")
1046 (let ((load-path (if (file-directory-p custom-theme-directory) 1047 (let ((load-path (if (file-directory-p custom-theme-directory)
1047 (cons custom-theme-directory load-path) 1048 (cons custom-theme-directory load-path)
1048 load-path))) 1049 load-path)))
@@ -1070,12 +1071,12 @@ All the themes loaded for BY-THEME are recorded in BY-THEME's property
1070 (let ((themes-loaded (get by-theme 'theme-loads-themes))) 1071 (let ((themes-loaded (get by-theme 'theme-loads-themes)))
1071 (dolist (theme body) 1072 (dolist (theme body)
1072 (cond ((and (consp theme) (eq (car theme) 'reset)) 1073 (cond ((and (consp theme) (eq (car theme) 'reset))
1073 (custom-disable-theme (cadr theme))) 1074 (disable-theme (cadr theme)))
1074 ((and (consp theme) (eq (car theme) 'hidden)) 1075 ((and (consp theme) (eq (car theme) 'hidden))
1075 (require-theme (cadr theme)) 1076 (load-theme (cadr theme))
1076 (custom-disable-theme (cadr theme))) 1077 (disable-theme (cadr theme)))
1077 (t 1078 (t
1078 (require-theme theme))) 1079 (load-theme theme)))
1079 (push theme themes-loaded)) 1080 (push theme themes-loaded))
1080 (put by-theme 'theme-loads-themes themes-loaded))) 1081 (put by-theme 'theme-loads-themes themes-loaded)))
1081 1082
@@ -1087,10 +1088,11 @@ See `custom-theme-load-themes' for more information on BODY."
1087 1088
1088;;; Enabling and disabling loaded themes. 1089;;; Enabling and disabling loaded themes.
1089 1090
1090(defun custom-enable-theme (theme) 1091(defun enable-theme (theme)
1091 "Reenable all variable and face settings defined by THEME. 1092 "Reenable all variable and face settings defined by THEME.
1092The newly enabled theme gets the highest precedence (after `user'). 1093The newly enabled theme gets the highest precedence (after `user').
1093If it is already enabled, just give it highest precedence (after `user')." 1094If it is already enabled, just give it highest precedence (after `user')."
1095 (interactive "SEnable Custom theme: ")
1094 (let ((settings (get theme 'theme-settings))) 1096 (let ((settings (get theme 'theme-settings)))
1095 (dolist (s settings) 1097 (dolist (s settings)
1096 (let* ((prop (car s)) 1098 (let* ((prop (car s))
@@ -1104,11 +1106,12 @@ If it is already enabled, just give it highest precedence (after `user')."
1104 (cons theme (delq theme custom-enabled-themes))) 1106 (cons theme (delq theme custom-enabled-themes)))
1105 ;; `user' must always be the highest-precedence enabled theme. 1107 ;; `user' must always be the highest-precedence enabled theme.
1106 (unless (eq theme 'user) 1108 (unless (eq theme 'user)
1107 (custom-enable-theme 'user))) 1109 (enable-theme 'user)))
1108 1110
1109(defun custom-disable-theme (theme) 1111(defun disable-theme (theme)
1110 "Disable all variable and face settings defined by THEME. 1112 "Disable all variable and face settings defined by THEME.
1111See `custom-known-themes' for a list of known themes." 1113See `custom-known-themes' for a list of known themes."
1114 (interactive "SDisable Custom theme: ")
1112 (let ((settings (get theme 'theme-settings))) 1115 (let ((settings (get theme 'theme-settings)))
1113 (dolist (s settings) 1116 (dolist (s settings)
1114 (let* ((prop (car s)) 1117 (let* ((prop (car s))