mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-14 16:50:58 +00:00
(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'.
This commit is contained in:
parent
e1db6c78fc
commit
9c4b6e94bf
@ -121,7 +121,7 @@ compatibility, DEFAULT is also stored in SYMBOL's property
|
|||||||
`standard-value'. At the same time, SYMBOL's property `force-value' is
|
`standard-value'. At the same time, SYMBOL's property `force-value' is
|
||||||
set to nil, as the value is no longer rogue."
|
set to nil, as the value is no longer rogue."
|
||||||
;; Remember the standard setting. The value should be in the standard
|
;; Remember the standard setting. The value should be in the standard
|
||||||
;; theme, not in this property. However, his would require changeing
|
;; theme, not in this property. However, this would require changing
|
||||||
;; the C source of defvar and others as well...
|
;; the C source of defvar and others as well...
|
||||||
(put symbol 'standard-value (list default))
|
(put symbol 'standard-value (list default))
|
||||||
;; Maybe this option was rogue in an earlier version. It no longer is.
|
;; 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."
|
|||||||
(t (condition-case nil (load load) (error nil))))))))
|
(t (condition-case nil (load load) (error nil))))))))
|
||||||
|
|
||||||
(defvar custom-known-themes '(user standard)
|
(defvar custom-known-themes '(user standard)
|
||||||
"Themes that have been define with `deftheme'.
|
"Themes that have been defined with `deftheme'.
|
||||||
The default value is the list (user standard). The theme `standard'
|
The default value is the list (user standard). The theme `standard'
|
||||||
contains the Emacs standard settings from the original Lisp files. The
|
contains the Emacs standard settings from the original Lisp files. The
|
||||||
theme `user' contains all the the settings the user customized and saved.
|
theme `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."
|
|||||||
(defvar custom-loaded-themes nil
|
(defvar custom-loaded-themes nil
|
||||||
"Themes in the order they are loaded.")
|
"Themes in the order they are loaded.")
|
||||||
|
|
||||||
|
(defcustom custom-theme-directory
|
||||||
|
(if (eq system-type 'ms-dos)
|
||||||
|
;; MS-DOS cannot have initial dot.
|
||||||
|
"~/_emacs.d/"
|
||||||
|
"~/.emacs.d/")
|
||||||
|
"Directory in which Custom theme files should be written.
|
||||||
|
`require-theme' searches this directory in addition to load-path.
|
||||||
|
The command `customize-create-theme' writes the files it produces
|
||||||
|
into this directory."
|
||||||
|
:type 'string
|
||||||
|
:group 'customize
|
||||||
|
:version "22.1")
|
||||||
|
|
||||||
(defun custom-theme-loaded-p (theme)
|
(defun custom-theme-loaded-p (theme)
|
||||||
"Return non-nil when THEME has been loaded."
|
"Return non-nil when THEME has been loaded."
|
||||||
(memq theme custom-loaded-themes))
|
(memq theme custom-loaded-themes))
|
||||||
@ -949,8 +962,11 @@ Usually the `theme-feature' property contains a symbol created
|
|||||||
by `custom-make-theme-feature'."
|
by `custom-make-theme-feature'."
|
||||||
;; Note we do no check for validity of the theme here.
|
;; Note we do no check for validity of the theme here.
|
||||||
;; This allows to pull in themes by a file-name convention
|
;; This allows to pull in themes by a file-name convention
|
||||||
(require (or (get theme 'theme-feature)
|
(let ((load-path (if (file-directory-p custom-theme-directory)
|
||||||
(custom-make-theme-feature theme))))
|
(cons custom-theme-directory load-path)
|
||||||
|
load-path)))
|
||||||
|
(require (or (get theme 'theme-feature)
|
||||||
|
(custom-make-theme-feature theme)))))
|
||||||
|
|
||||||
(defun custom-remove-theme (spec-alist theme)
|
(defun custom-remove-theme (spec-alist theme)
|
||||||
"Delete all elements from SPEC-ALIST whose car is THEME."
|
"Delete all elements from SPEC-ALIST whose car is THEME."
|
||||||
|
Loading…
Reference in New Issue
Block a user