]> code.delx.au - gnu-emacs/commitdiff
Fix handling of frame color parameters in TTY sessions (Bug#19802)
authorEli Zaretskii <eliz@gnu.org>
Sun, 8 Feb 2015 16:17:40 +0000 (18:17 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 8 Feb 2015 16:17:40 +0000 (18:17 +0200)
 src/xfaces.c (map_tty_color): Use assoc_no_quit instead of
 assq_no_quit to fetch color definition by its string name.

 lisp/frame.el (frame-notice-user-settings): Refresh the value of
 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.

lisp/ChangeLog
lisp/frame.el
src/ChangeLog
src/xfaces.c

index 17b3d112432a653152e2f2b1fe1e7828e7985f56..79e3378b2e88cdd8aa66c64e55148fbf55f77d43 100644 (file)
@@ -1,3 +1,12 @@
+2015-02-08  Eli Zaretskii  <eliz@gnu.org>
+
+       * frame.el (frame-notice-user-settings): Refresh the value of
+       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)
+
 2015-02-06  Wolfgang Jenkner  <wjenkner@inode.at>
 
        * net/network-stream.el (network-stream-open-tls): Respect the
index c77df558da8dd66b8c461efeb4fe6195b435add9..eea5c24a82d6ed67177a3f5b5f35ffeff95db32d 100644 (file)
@@ -251,6 +251,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.
@@ -258,7 +262,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.
@@ -1185,7 +1189,9 @@ 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)))))
 
 (defun set-foreground-color (color-name)
   "Set the foreground color of the selected frame to COLOR-NAME.
@@ -1195,7 +1201,9 @@ 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)))))
 
 (defun set-cursor-color (color-name)
   "Set the text cursor color of the selected frame to COLOR-NAME.
index 135f28fb20f2e28d50225ef8774fc3068a2a3b02..7a7fd23d43dae79d5aafd14035738807906fd70b 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-08  Eli Zaretskii  <eliz@gnu.org>
+
+       * xfaces.c (map_tty_color): Use assoc_no_quit instead of
+       assq_no_quit to fetch color definition by its string name.
+       (Bug#19802)
+
 2015-02-05  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (move_it_in_display_line_to): Handle the case where the
index 44c72aa4944a15e80ecd078abe728342e3c73e19..29c91f7169fabfabdc1c665221b2cf2649a0f738 100644 (file)
@@ -5793,7 +5793,7 @@ map_tty_color (struct frame *f, struct face *face,
   if (STRINGP (color)
       && SCHARS (color)
       && CONSP (Vtty_defined_color_alist)
-      && (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)),
+      && (def = assoc_no_quit (color, call1 (Qtty_color_alist, frame)),
          CONSP (def)))
     {
       /* Associations in tty-defined-color-alist are of the form