diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-04-04 21:21:52 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-04-04 21:21:52 -0400 |
commit | 3b2ff876a5b9280a2c634137338cf78cd4ea588c (patch) | |
tree | 4acd620c29b47d43568c0756068118757e01c5bb /lisp/custom.el | |
parent | 6f4e1aeddaa0c767fc2490da8e490565bf6182e2 (diff) | |
download | emacs-3b2ff876a5b9280a2c634137338cf78cd4ea588c.tar.gz |
Fix theme and X-resource interactions for the cursor face.
* lisp/startup.el (command-line): Save the cursor's theme-face
directly, instead of using face-override-spec.
* lisp/custom.el (load-theme): Minor optimization in assigning faces.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r-- | lisp/custom.el | 14 |
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)))) |