summaryrefslogtreecommitdiff
path: root/lisp/frame.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-03-03 14:37:43 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-03-03 14:37:43 -0800
commite2ae1c5a40e2802fcd9f5ee26b4906be97c8b878 (patch)
treeb2d56b00e2ae8ba90167ede434561d4a3b1f273d /lisp/frame.el
parentd8462361f2d087d6f7c745305c61a266843ee19c (diff)
parent4b0b27d0018f040bda6a2ec885fa54c666d9c083 (diff)
downloademacs-e2ae1c5a40e2802fcd9f5ee26b4906be97c8b878.tar.gz
Merge from origin/emacs-24
4b0b27d Fix invocation of commands whose file name includes extension 87fc99f Better support for the case of typing RET on the prompt in comint. a7b1c2f Don't lose frame's background color when setting foreground 20c817d Fix handling of frame color parameters in TTY sessions eca7da1 Complete the remaining documentation updates for 24.5 Conflicts: doc/lispref/ChangeLog etc/NEWS lisp/ChangeLog nt/ChangeLog src/ChangeLog
Diffstat (limited to 'lisp/frame.el')
-rw-r--r--lisp/frame.el26
1 files changed, 23 insertions, 3 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index c81ee9bfa61..94e581b1e24 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -259,6 +259,10 @@ there (in decreasing order of priority)."
(let ((newparms (frame-parameters))
(frame (selected-frame)))
(tty-handle-reverse-video frame newparms)
+ ;; tty-handle-reverse-video might change the frame's
+ ;; color parameters, and we need to use the updated
+ ;; value below.
+ (setq newparms (frame-parameters))
;; If we changed the background color, we need to update
;; the background-mode parameter, and maybe some faces,
;; too.
@@ -266,7 +270,7 @@ there (in decreasing order of priority)."
(unless (or (assq 'background-mode initial-frame-alist)
(assq 'background-mode default-frame-alist))
(frame-set-background-mode frame))
- (face-set-after-frame-default frame))))))
+ (face-set-after-frame-default frame newparms))))))
;; If the initial frame is still around, apply initial-frame-alist
;; and default-frame-alist to it.
@@ -1201,7 +1205,15 @@ To get the frame's current background color, use `frame-parameters'."
(modify-frame-parameters (selected-frame)
(list (cons 'background-color color-name)))
(or window-system
- (face-set-after-frame-default (selected-frame))))
+ (face-set-after-frame-default (selected-frame)
+ (list
+ (cons 'background-color color-name)
+ ;; Pass the foreground-color as
+ ;; well, if defined, to avoid
+ ;; losing it when faces are reset
+ ;; to their defaults.
+ (assq 'foreground-color
+ (frame-parameters))))))
(defun set-foreground-color (color-name)
"Set the foreground color of the selected frame to COLOR-NAME.
@@ -1211,7 +1223,15 @@ To get the frame's current foreground color, use `frame-parameters'."
(modify-frame-parameters (selected-frame)
(list (cons 'foreground-color color-name)))
(or window-system
- (face-set-after-frame-default (selected-frame))))
+ (face-set-after-frame-default (selected-frame)
+ (list
+ (cons 'foreground-color color-name)
+ ;; Pass the background-color as
+ ;; well, if defined, to avoid
+ ;; losing it when faces are reset
+ ;; to their defaults.
+ (assq 'background-color
+ (frame-parameters))))))
(defun set-cursor-color (color-name)
"Set the text cursor color of the selected frame to COLOR-NAME.