X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/53b39e8977941c6b60deeeca3c0e54da9ec7961a..ed6ec139ac9d21dede5800ce9aeb3b90014ad06a:/lisp/custom.el diff --git a/lisp/custom.el b/lisp/custom.el index 0df22a8b89..4ee1d45a1b 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1,6 +1,7 @@ ;;; custom.el --- tools for declaring and initializing options ;; -;; Copyright (C) 1996-1997, 1999, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1996-1997, 1999, 2001-2014 Free Software Foundation, +;; Inc. ;; ;; Author: Per Abrahamsen ;; Maintainer: FSF @@ -353,7 +354,7 @@ FACE does not need to be quoted. Third argument DOC is the face documentation. -If FACE has been set with `custom-set-faces', set the face +If FACE has been set with `custom-theme-set-faces', set the face attributes as specified by that function, otherwise set the face attributes according to SPEC. @@ -361,7 +362,7 @@ The remaining arguments should have the form [KEYWORD VALUE]... For a list of valid keywords, see the common keywords listed in `defcustom'. -SPEC should be an alist of the form +SPEC should be a \"face spec\", i.e., an alist of the form ((DISPLAY . ATTS)...) @@ -869,20 +870,21 @@ See `custom-known-themes' for a list of known themes." (setcar (cdr setting) value))) ;; Add a new setting: (t - (unless old - ;; If the user changed a variable outside of Customize, save - ;; the value to a fake theme, `changed'. If the theme is - ;; later disabled, we use this to bring back the old value. - ;; - ;; For faces, we just use `face-new-frame-defaults' to - ;; recompute when the theme is disabled. - (when (and (eq prop 'theme-value) - (boundp symbol)) - (let ((sv (get symbol 'standard-value)) - (val (symbol-value symbol))) - (unless (and sv (equal (eval (car sv)) val)) - (setq old `((changed ,(custom-quote val)))))))) - (put symbol prop (cons (list theme value) old)) + (unless custom--inhibit-theme-enable + (unless old + ;; If the user changed a variable outside of Customize, save + ;; the value to a fake theme, `changed'. If the theme is + ;; later disabled, we use this to bring back the old value. + ;; + ;; For faces, we just use `face-new-frame-defaults' to + ;; recompute when the theme is disabled. + (when (and (eq prop 'theme-value) + (boundp symbol)) + (let ((sv (get symbol 'standard-value)) + (val (symbol-value symbol))) + (unless (and sv (equal (eval (car sv)) val)) + (setq old `((changed ,(custom-quote val)))))))) + (put symbol prop (cons (list theme value) old))) (put theme 'theme-settings (cons (list prop symbol theme value) theme-settings)))))) @@ -1276,7 +1278,14 @@ NAME should be a symbol." (eq name 'changed))))) (defun custom-available-themes () - "Return a list of available Custom themes (symbols)." + "Return a list of Custom themes available for loading. +Search the directories specified by `custom-theme-load-path' for +files named FOO-theme.el, and return a list of FOO symbols. + +The returned symbols may not correspond to themes that have been +loaded, and no effort is made to check that the files contain +valid Custom themes. For a list of loaded themes, check the +variable `custom-known-themes'." (let (sym themes) (dolist (dir (custom-theme--load-path)) (when (file-directory-p dir) @@ -1451,12 +1460,15 @@ This function returns nil if no custom theme specifies a value for VARIABLE." (eval (car valspec)))))) (defun custom-theme-recalc-face (face) - "Set FACE according to currently enabled custom themes." + "Set FACE according to currently enabled custom themes. +If FACE is not initialized as a face, do nothing; otherwise call +`face-spec-recalc' to recalculate the face on all frames." (if (get face 'face-alias) (setq face (get face 'face-alias))) - ;; Reset the faces for each frame. - (dolist (frame (frame-list)) - (face-spec-recalc face frame))) + (if (facep face) + ;; Reset the faces for each frame. + (dolist (frame (frame-list)) + (face-spec-recalc face frame)))) ;;; XEmacs compatibility functions