aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-04-04 21:21:52 -0400
committerChong Yidong2011-04-04 21:21:52 -0400
commit3b2ff876a5b9280a2c634137338cf78cd4ea588c (patch)
tree4acd620c29b47d43568c0756068118757e01c5bb
parent6f4e1aeddaa0c767fc2490da8e490565bf6182e2 (diff)
downloademacs-3b2ff876a5b9280a2c634137338cf78cd4ea588c.tar.gz
emacs-3b2ff876a5b9280a2c634137338cf78cd4ea588c.zip
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.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/custom.el14
-rw-r--r--lisp/startup.el3
3 files changed, 23 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8c978e2b33c..0037d37110e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12011-04-05 Chong Yidong <cyd@stupidchicken.com>
2
3 * startup.el (command-line): Save the cursor's theme-face
4 directly, instead of using face-override-spec.
5
6 * custom.el (load-theme): Minor optimization in assigning faces.
7
12011-04-04 Juanma Barranquero <lekktu@gmail.com> 82011-04-04 Juanma Barranquero <lekktu@gmail.com>
2 9
3 * help-fns.el (describe-variable): Complete all variables having 10 * help-fns.el (describe-variable): Complete all variables having
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."
1151 (custom-theme-load-confirm hash)) 1151 (custom-theme-load-confirm hash))
1152 (let ((custom--inhibit-theme-enable t)) 1152 (let ((custom--inhibit-theme-enable t))
1153 (eval-buffer)) 1153 (eval-buffer))
1154 ;; Optimization: if the theme changes the `default' face, put that
1155 ;; entry first. This avoids some `frame-set-background-mode' rigmarole
1156 ;; by assigning the new background immediately.
1157 (let* ((settings (get theme 'theme-settings))
1158 (tail settings)
1159 found)
1160 (while (and tail (not found))
1161 (and (eq (nth 0 (car tail)) 'theme-face)
1162 (eq (nth 1 (car tail)) 'default)
1163 (setq found (car tail)))
1164 (setq tail (cdr tail)))
1165 (if found
1166 (put theme 'theme-settings (cons found (delq found settings)))))
1167 ;; Finally, enable the theme.
1154 (unless no-enable 1168 (unless no-enable
1155 (enable-theme theme)) 1169 (enable-theme theme))
1156 t)))) 1170 t))))
diff --git a/lisp/startup.el b/lisp/startup.el
index d2184778212..3285d47f088 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -906,7 +906,8 @@ opening the first frame (e.g. open a connection to an X server).")
906 ;; spec, but mark it as changed outside of Customize. 906 ;; spec, but mark it as changed outside of Customize.
907 (let ((color (x-get-resource "cursorColor" "CursorColor"))) 907 (let ((color (x-get-resource "cursorColor" "CursorColor")))
908 (when color 908 (when color
909 (face-spec-set 'cursor `((t (:background ,color)))) 909 (put 'cursor 'theme-face
910 `((changed ((t :background ,color)))))
910 (put 'cursor 'face-modified t))))) 911 (put 'cursor 'face-modified t)))))
911 (frame-initialize)) 912 (frame-initialize))
912 913