aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2013-06-18 10:46:53 +0000
committerKatsumi Yamaoka2013-06-18 10:46:53 +0000
commitf462d10ac4f144ccd0833b4e745f7f51aa3eb1bb (patch)
tree7958b334f64910be5fa742a076bbda83ce875644
parentdb5a34cae7ead2df3515f939b6cd6f1c1f889c2e (diff)
downloademacs-f462d10ac4f144ccd0833b4e745f7f51aa3eb1bb.tar.gz
emacs-f462d10ac4f144ccd0833b4e745f7f51aa3eb1bb.zip
Don't colourise images from tables
* shr.el (shr-tag-table): Insert the images after the table, so that they're not covered by the table coulorisation, which often looked awkward.
-rw-r--r--lisp/gnus/ChangeLog6
-rw-r--r--lisp/gnus/shr.el16
2 files changed, 14 insertions, 8 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c96702260fc..8718b9d4ca7 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,9 @@
12013-06-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * shr.el (shr-tag-table): Insert the images after the table, so that
4 they're not covered by the table colourisation, which often looked
5 awkward.
6
12013-06-18 Katsumi Yamaoka <yamaoka@jpl.org> 72013-06-18 Katsumi Yamaoka <yamaoka@jpl.org>
2 8
3 * eww.el (eww-detect-charset): Improve regexp; move backward. 9 * eww.el (eww-detect-charset): Improve regexp; move backward.
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 06abde9e381..1c940bebc50 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -1248,13 +1248,7 @@ ones, in case fg and bg are nil."
1248 (frame-width)) 1248 (frame-width))
1249 (setq truncate-lines t)) 1249 (setq truncate-lines t))
1250 ;; Then render the table again with these new "hard" widths. 1250 ;; Then render the table again with these new "hard" widths.
1251 (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)) 1251 (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)))
1252 ;; Finally, insert all the images after the table. The Emacs buffer
1253 ;; model isn't strong enough to allow us to put the images actually
1254 ;; into the tables.
1255 (when (zerop shr-table-depth)
1256 (dolist (elem (shr-find-elements cont 'img))
1257 (shr-tag-img (cdr elem)))))
1258 1252
1259(defun shr-tag-table (cont) 1253(defun shr-tag-table (cont)
1260 (shr-ensure-paragraph) 1254 (shr-ensure-paragraph)
@@ -1318,7 +1312,13 @@ ones, in case fg and bg are nil."
1318 body)))))) 1312 body))))))
1319 (when bgcolor 1313 (when bgcolor
1320 (shr-colorize-region start (point) (cdr (assq 'color shr-stylesheet)) 1314 (shr-colorize-region start (point) (cdr (assq 'color shr-stylesheet))
1321 bgcolor)))) 1315 bgcolor))
1316 ;; Finally, insert all the images after the table. The Emacs buffer
1317 ;; model isn't strong enough to allow us to put the images actually
1318 ;; into the tables.
1319 (when (zerop shr-table-depth)
1320 (dolist (elem (shr-find-elements cont 'img))
1321 (shr-tag-img (cdr elem))))))
1322 1322
1323(defun shr-find-elements (cont type) 1323(defun shr-find-elements (cont type)
1324 (let (result) 1324 (let (result)