From fabb502cdc40a3e17d3314651d2f95acb346f003 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 4 Feb 2011 03:35:25 -0800 Subject: [PATCH] * shr.el (shr-render-td): Store the actual background colour used. --- lisp/ChangeLog | 2 ++ lisp/shr.el | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9522f8295..cf5d98c2d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2011-02-04 Lars Ingebrigtsen + * shr.el (shr-render-td): Store the actual background colour used. + * message.el (message-setup-1): Don't bind the constant -forbidden-properties. (message-setup-1): Revert previous change, since it needs to bind the diff --git a/lisp/shr.el b/lisp/shr.el index 10e04a87d..5b4e6c738 100644 --- a/lisp/shr.el +++ b/lisp/shr.el @@ -601,7 +601,8 @@ ones, in case fg and bg are nil." (when fg (shr-put-color start end :foreground (cadr new-colors))) (when bg - (shr-put-color start end :background (car new-colors))))))) + (shr-put-color start end :background (car new-colors)))) + new-colors))) ;; Put a color in the region, but avoid putting colors on on blank ;; text at the start of the line, and the newline at the end, to avoid @@ -1126,7 +1127,7 @@ ones, in case fg and bg are nil." (fgcolor (cdr (assq :fgcolor cont))) (style (cdr (assq :style cont))) (shr-stylesheet shr-stylesheet) - overlays) + overlays actual-colors) (when style (setq style (and (string-match "color" style) (shr-parse-style style)))) @@ -1178,16 +1179,17 @@ ones, in case fg and bg are nil." (insert (make-string (- width (current-column)) ? ))) (forward-line 1))) (when style - (shr-colorize-region - (point-min) (point-max) - (cdr (assq 'color shr-stylesheet)) - (cdr (assq 'background-color shr-stylesheet))))) + (setq actual-colors + (shr-colorize-region + (point-min) (point-max) + (cdr (assq 'color shr-stylesheet)) + (cdr (assq 'background-color shr-stylesheet)))))) (if fill (list max (count-lines (point-min) (point-max)) (split-string (buffer-string) "\n") (shr-collect-overlays) - (cdr (assq 'background-color shr-stylesheet))) + (car actual-colors)) (list max (shr-natural-width))))))) -- 2.25.1