bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19791: 25.0.50; Bad HTML rendering


From: Eli Zaretskii
Subject: bug#19791: 25.0.50; Bad HTML rendering
Date: Sun, 08 Feb 2015 19:52:34 +0200

> Date: Sat, 07 Feb 2015 13:57:04 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 19791@debbugs.gnu.org, rms@gnu.org
> 
> > From: Lars Ingebrigtsen <larsi@gnus.org>
> > Cc: 19791@debbugs.gnu.org, rms@gnu.org
> > Date: Sat, 07 Feb 2015 12:30:42 +1100
> > 
> > Eli Zaretskii <eliz@gnu.org> writes:
> > 
> > > Where's that in the sources?
> > 
> > `shr-color-check' and `shr-color-visible'.
> 
> I think I see the problem: it is somehow related to bug #19802.  In
> particular, even if I do this:
> 
>   M-: (set-frame-parameter (selected-frame) 'background-color "black") RET
> 
> I still get nil from (frame-parameter nil 'background-color).  And
> shr-color-check relies on the latter to report the background color of
> the frame.
> 
> So I guess solving that bug will also solve this, or at least move
> closer to its solution.

This turned out to be broken in more than one way, some of them only
on master.  The patch to fix them, relative to the current master, is
below.  I installed the changes on the branch and will install the
master part shortly.

Richard, could you please see if this solves the problem with
"invisible" colors in HTML mails for you?  It did for me.

diff --git a/lisp/frame.el b/lisp/frame.el
index ecb433e..8dce86b 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -259,6 +259,10 @@ (defun frame-notice-user-settings ()
            (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 @@ (defun frame-notice-user-settings ()
                (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.
@@ -1200,7 +1204,9 @@ (defun set-background-color (color-name)
   (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.
@@ -1210,7 +1216,9 @@ (defun set-foreground-color (color-name)
   (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.
diff --git a/src/frame.c b/src/frame.c
index 96fe377..9060f56 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2615,7 +2615,12 @@ It is a list of elements of the form (PARM . VALUE), 
where PARM is a symbol.
                 important when param_alist's notion of colors is
                 "unspecified".  We need to do the same here.  */
              if (STRINGP (value) && !FRAME_WINDOW_P (f))
-               value = frame_unspecified_color (f, value);
+               {
+                 Lisp_Object tem = frame_unspecified_color (f, value);
+
+                 if (!NILP (tem))
+                   value = tem;
+               }
            }
          else
            value = Fcdr (Fassq (parameter, Fframe_parameters (frame)));
diff --git a/src/xfaces.c b/src/xfaces.c
index 6e01ab0..6866aa8 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5703,7 +5703,7 @@ ALIST is an alist of (REGISTRY ALTERNATIVE1 ALTERNATIVE2 
...) entries.
   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





reply via email to

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