aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2005-07-02 22:52:27 +0000
committerLuc Teirlinck2005-07-02 22:52:27 +0000
commit9c4b6e94bf6c993cb1ecea4ebd9f683c9b4c63fc (patch)
treeb67d3b3bccf41a5775c99c149e97d943fbe1b309
parente1db6c78fc71d58f47d783d620154eadb87d3ed0 (diff)
downloademacs-9c4b6e94bf6c993cb1ecea4ebd9f683c9b4c63fc.tar.gz
emacs-9c4b6e94bf6c993cb1ecea4ebd9f683c9b4c63fc.zip
(custom-declare-variable): Fix typos in comment.
(custom-known-themes): Doc fix. (custom-theme-directory): New defcustom. (require-theme): Make it check `custom-theme-directory'.
-rw-r--r--lisp/custom.el24
1 files changed, 20 insertions, 4 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index f3cbd1404e9..a438ee7d5fe 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -121,7 +121,7 @@ compatibility, DEFAULT is also stored in SYMBOL's property
121`standard-value'. At the same time, SYMBOL's property `force-value' is 121`standard-value'. At the same time, SYMBOL's property `force-value' is
122set to nil, as the value is no longer rogue." 122set to nil, as the value is no longer rogue."
123 ;; Remember the standard setting. The value should be in the standard 123 ;; Remember the standard setting. The value should be in the standard
124 ;; theme, not in this property. However, his would require changeing 124 ;; theme, not in this property. However, this would require changing
125 ;; the C source of defvar and others as well... 125 ;; the C source of defvar and others as well...
126 (put symbol 'standard-value (list default)) 126 (put symbol 'standard-value (list default))
127 ;; Maybe this option was rogue in an earlier version. It no longer is. 127 ;; Maybe this option was rogue in an earlier version. It no longer is.
@@ -560,7 +560,7 @@ LOAD should be either a library file name, or a feature name."
560 (t (condition-case nil (load load) (error nil)))))))) 560 (t (condition-case nil (load load) (error nil))))))))
561 561
562(defvar custom-known-themes '(user standard) 562(defvar custom-known-themes '(user standard)
563 "Themes that have been define with `deftheme'. 563 "Themes that have been defined with `deftheme'.
564The default value is the list (user standard). The theme `standard' 564The default value is the list (user standard). The theme `standard'
565contains the Emacs standard settings from the original Lisp files. The 565contains the Emacs standard settings from the original Lisp files. The
566theme `user' contains all the the settings the user customized and saved. 566theme `user' contains all the the settings the user customized and saved.
@@ -926,6 +926,19 @@ Return non-nil iff the `customized-value' property actually changed."
926(defvar custom-loaded-themes nil 926(defvar custom-loaded-themes nil
927 "Themes in the order they are loaded.") 927 "Themes in the order they are loaded.")
928 928
929(defcustom custom-theme-directory
930 (if (eq system-type 'ms-dos)
931 ;; MS-DOS cannot have initial dot.
932 "~/_emacs.d/"
933 "~/.emacs.d/")
934 "Directory in which Custom theme files should be written.
935`require-theme' searches this directory in addition to load-path.
936The command `customize-create-theme' writes the files it produces
937into this directory."
938 :type 'string
939 :group 'customize
940 :version "22.1")
941
929(defun custom-theme-loaded-p (theme) 942(defun custom-theme-loaded-p (theme)
930 "Return non-nil when THEME has been loaded." 943 "Return non-nil when THEME has been loaded."
931 (memq theme custom-loaded-themes)) 944 (memq theme custom-loaded-themes))
@@ -949,8 +962,11 @@ Usually the `theme-feature' property contains a symbol created
949by `custom-make-theme-feature'." 962by `custom-make-theme-feature'."
950 ;; Note we do no check for validity of the theme here. 963 ;; Note we do no check for validity of the theme here.
951 ;; This allows to pull in themes by a file-name convention 964 ;; This allows to pull in themes by a file-name convention
952 (require (or (get theme 'theme-feature) 965 (let ((load-path (if (file-directory-p custom-theme-directory)
953 (custom-make-theme-feature theme)))) 966 (cons custom-theme-directory load-path)
967 load-path)))
968 (require (or (get theme 'theme-feature)
969 (custom-make-theme-feature theme)))))
954 970
955(defun custom-remove-theme (spec-alist theme) 971(defun custom-remove-theme (spec-alist theme)
956 "Delete all elements from SPEC-ALIST whose car is THEME." 972 "Delete all elements from SPEC-ALIST whose car is THEME."