summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-04-04 23:45:27 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-04-04 23:45:27 -0700
commitca23cc8840efb1354ebe16c6bb99bf1f8880e9b6 (patch)
treee95220daac6b9ffb47966df747308a11c0623179 /lisp/custom.el
parentd5efd1d1b54595db795d6fddb32404cc74923d77 (diff)
parentb87a82007428428e2f24af64a59799402bb1651e (diff)
downloademacs-ca23cc8840efb1354ebe16c6bb99bf1f8880e9b6.tar.gz
emacs-ca23cc8840efb1354ebe16c6bb99bf1f8880e9b6.tar.bz2
emacs-ca23cc8840efb1354ebe16c6bb99bf1f8880e9b6.zip
Merge from mainline.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 5b5592698d8..964d8d9ea4a 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1151,6 +1151,20 @@ Return t if THEME was successfully loaded, nil otherwise."
(custom-theme-load-confirm hash))
(let ((custom--inhibit-theme-enable t))
(eval-buffer))
+ ;; Optimization: if the theme changes the `default' face, put that
+ ;; entry first. This avoids some `frame-set-background-mode' rigmarole
+ ;; by assigning the new background immediately.
+ (let* ((settings (get theme 'theme-settings))
+ (tail settings)
+ found)
+ (while (and tail (not found))
+ (and (eq (nth 0 (car tail)) 'theme-face)
+ (eq (nth 1 (car tail)) 'default)
+ (setq found (car tail)))
+ (setq tail (cdr tail)))
+ (if found
+ (put theme 'theme-settings (cons found (delq found settings)))))
+ ;; Finally, enable the theme.
(unless no-enable
(enable-theme theme))
t))))