]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't lose frame's background color when setting foreground (Bug#19802)
authorEli Zaretskii <eliz@gnu.org>
Sun, 8 Feb 2015 18:09:19 +0000 (20:09 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 8 Feb 2015 18:09:19 +0000 (20:09 +0200)
 lisp/frame.el ((set-background-color, set-foreground-color): Pass the
 other color, if defined, to face-set-after-frame-default.

lisp/ChangeLog
lisp/frame.el

index 79e3378b2e88cdd8aa66c64e55148fbf55f77d43..728b9833c9f5a1e53a925f144b8efa2bb11f568a 100644 (file)
@@ -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  <wjenkner@inode.at>
 
index eea5c24a82d6ed67177a3f5b5f35ffeff95db32d..1a584fa0e2ca300e13b2e442531e924b0b113827 100644 (file)
@@ -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.