emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 a7b1c2f: Don't lose frame's background color when


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 a7b1c2f: Don't lose frame's background color when setting foreground (Bug#19802)
Date: Sun, 08 Feb 2015 18:11:12 +0000

branch: emacs-24
commit a7b1c2f88f06bbeda16117c0aa1caffac1b4ebe1
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Don't lose frame's background color when setting foreground  (Bug#19802)
    
     lisp/frame.el ((set-background-color, set-foreground-color): Pass the
     other color, if defined, to face-set-after-frame-default.
---
 lisp/ChangeLog |    4 ++--
 lisp/frame.el  |   16 ++++++++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 79e3378..728b983 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,8 +4,8 @@
        frame parameters after calling tty-handle-reverse-video.  Call
        face-set-after-frame-default with the actual parameters, to avoid
        resetting colors back to unspecified.
-       (set-background-color, set-foreground-color): Pass the selected
-       color to face-set-after-frame-default.  (Bug#19802)
+       (set-background-color, set-foreground-color): Pass the foreground
+       and background colors to face-set-after-frame-default.  (Bug#19802)
 
 2015-02-06  Wolfgang Jenkner  <address@hidden>
 
diff --git a/lisp/frame.el b/lisp/frame.el
index eea5c24..1a584fa 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1191,7 +1191,13 @@ To get the frame's current background color, use 
`frame-parameters'."
   (or window-system
       (face-set-after-frame-default (selected-frame)
                                    (list
-                                    (cons 'background-color color-name)))))
+                                    (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.
@@ -1203,7 +1209,13 @@ To get the frame's current foreground color, use 
`frame-parameters'."
   (or window-system
       (face-set-after-frame-default (selected-frame)
                                    (list
-                                    (cons 'foreground-color color-name)))))
+                                    (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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]