aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGnus developers2010-12-06 22:16:10 +0000
committerKatsumi Yamaoka2010-12-06 22:16:10 +0000
commitb31b26b48958fed0162d58c76dc55b2aeca22b66 (patch)
tree4221b7cc8a36f0be7397ac3866f3241b5256ccf6
parent67027b49796eec01dccf1e14d7b0497b2d484328 (diff)
downloademacs-b31b26b48958fed0162d58c76dc55b2aeca22b66.tar.gz
emacs-b31b26b48958fed0162d58c76dc55b2aeca22b66.zip
Merge changes made in Gnus trunk.
shr.el (shr-render-td): Render td content with shr-descend, so style will be applied to <td> too. (shr-colorize-region): Colorize region even if we only have a background. (shr-tag-body): Fix color and background color inheritance. (shr-tag-body): Do not recolorize after shr-generic. (shr-tag-font): Let shr-generic colorize via inheritance. shr.el (shr-descend): Only colorise something if we have a node that sets colors. gnus-int.el (gnus-request-thread): Rework to take a header instead of a Message-ID to avoid having nnimap depend on gnus-sum. shr.el (shr-tag-font): Colorize the region. (shr-tag-body): Ditto. (shr-tag-font): Actually let the styles be inherited instead of overwriting them. (shr-tag-font): Get the background color right. (shr-tag-style): Ignore all <style> tags for the moment.
-rw-r--r--lisp/gnus/ChangeLog24
-rw-r--r--lisp/gnus/gnus-int.el7
-rw-r--r--lisp/gnus/gnus-sum.el2
-rw-r--r--lisp/gnus/nnimap.el10
-rw-r--r--lisp/gnus/shr.el41
5 files changed, 56 insertions, 28 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f36598780b4..ef4a7637b6d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,27 @@
12010-12-06 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * shr.el (shr-tag-font): Colorize the region.
4 (shr-tag-body): Ditto.
5 (shr-tag-font): Actually let the styles be inherited instead of
6 overwriting them.
7 (shr-tag-font): Get the background color right.
8 (shr-tag-style): Ignore all <style> tags for the moment.
9
10 * gnus-int.el (gnus-request-thread): Rework to take a header instead of
11 a Message-ID to avoid having nnimap depend on gnus-sum.
12
13 * shr.el (shr-descend): Only colorize something if we have a node that
14 sets colors.
15
162010-12-06 Julien Danjou <julien@danjou.info>
17
18 * shr.el (shr-render-td): Render td content with shr-descend, so style
19 will be applied to <td> too.
20 (shr-colorize-region): Colorize region even if we only have a background.
21 (shr-tag-body): Fix color and background color inheritance.
22 Do not recolorize after shr-generic.
23 (shr-tag-font): Let shr-generic colorize via inheritance.
24
12010-12-06 Katsumi Yamaoka <yamaoka@jpl.org> 252010-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
2 26
3 * shr.el (shr-find-fill-point): Don't regard apostrophe as kinsoku-bol. 27 * shr.el (shr-find-fill-point): Don't regard apostrophe as kinsoku-bol.
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 767ac2e9fc5..43284540125 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -503,12 +503,11 @@ If BUFFER, insert the article in that group."
503 article (gnus-group-real-name group) 503 article (gnus-group-real-name group)
504 (nth 1 gnus-command-method) buffer))) 504 (nth 1 gnus-command-method) buffer)))
505 505
506(defun gnus-request-thread (id) 506(defun gnus-request-thread (header)
507 "Request the headers in the thread containing the article 507 "Request the headers in the thread containing the article specified by HEADER."
508specified by Message-ID id."
509 (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) 508 (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name)))
510 (funcall (gnus-get-function gnus-command-method 'request-thread) 509 (funcall (gnus-get-function gnus-command-method 'request-thread)
511 id))) 510 header)))
512 511
513(defun gnus-warp-to-article () 512(defun gnus-warp-to-article ()
514 "Warps from an article in a virtual group to the article in its 513 "Warps from an article in a virtual group to the article in its
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 2bb39af3fb8..1bb4b4a6895 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -8880,7 +8880,7 @@ variable."
8880 'list gnus-newsgroup-headers 8880 'list gnus-newsgroup-headers
8881 (if (gnus-check-backend-function 8881 (if (gnus-check-backend-function
8882 'request-thread gnus-newsgroup-name) 8882 'request-thread gnus-newsgroup-name)
8883 (gnus-request-thread id) 8883 (gnus-request-thread (gnus-summary-article-header))
8884 (let* ((last (if (numberp limit) 8884 (let* ((last (if (numberp limit)
8885 (min (+ (mail-header-number 8885 (min (+ (mail-header-number
8886 (gnus-summary-article-header)) 8886 (gnus-summary-article-header))
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 4b4793dcfee..c7d61399dec 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -47,9 +47,6 @@
47(require 'nnmail) 47(require 'nnmail)
48(require 'proto-stream) 48(require 'proto-stream)
49 49
50(eval-when-compile
51 (require 'gnus-sum))
52
53(autoload 'auth-source-forget-user-or-password "auth-source") 50(autoload 'auth-source-forget-user-or-password "auth-source")
54(autoload 'auth-source-user-or-password "auth-source") 51(autoload 'auth-source-user-or-password "auth-source")
55 52
@@ -1426,9 +1423,10 @@ textual parts.")
1426 (setq nnimap-status-string "Read-only server") 1423 (setq nnimap-status-string "Read-only server")
1427 nil) 1424 nil)
1428 1425
1429(deffoo nnimap-request-thread (id) 1426(deffoo nnimap-request-thread (header)
1430 (let* ((refs (split-string 1427 (let* ((id (mail-header-id header))
1431 (or (mail-header-references (gnus-summary-article-header)) 1428 (refs (split-string
1429 (or (mail-header-references header)
1432 ""))) 1430 "")))
1433 (cmd (let ((value 1431 (cmd (let ((value
1434 (format 1432 (format
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 4c4f47e0225..fafe3d94dea 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -194,19 +194,19 @@ redirects somewhere else."
194 (style (cdr (assq :style (cdr dom)))) 194 (style (cdr (assq :style (cdr dom))))
195 (shr-stylesheet shr-stylesheet) 195 (shr-stylesheet shr-stylesheet)
196 (start (point))) 196 (start (point)))
197 (when (and style 197 (when style
198 (string-match "color" style)) 198 (if (string-match "color" style)
199 (setq shr-stylesheet (nconc (shr-parse-style style) 199 (setq shr-stylesheet (nconc (shr-parse-style style)
200 shr-stylesheet))) 200 shr-stylesheet))
201 (setq style nil)))
201 (if (fboundp function) 202 (if (fboundp function)
202 (funcall function (cdr dom)) 203 (funcall function (cdr dom))
203 (shr-generic (cdr dom))) 204 (shr-generic (cdr dom)))
204 (let ((color (cdr (assq 'color shr-stylesheet))) 205 ;; If style is set, then this node has set the color.
205 (background (cdr (assq 'background-color 206 (when style
206 shr-stylesheet)))) 207 (shr-colorize-region start (point)
207 (when (and shr-stylesheet 208 (cdr (assq 'color shr-stylesheet))
208 (or color background)) 209 (cdr (assq 'background-color shr-stylesheet))))))
209 (shr-colorize-region start (point) color background)))))
210 210
211(defun shr-generic (cont) 211(defun shr-generic (cont)
212 (dolist (sub cont) 212 (dolist (sub cont)
@@ -586,7 +586,7 @@ ones, in case fg and bg are nil."
586 (shr-color-visible bg fg))))))) 586 (shr-color-visible bg fg)))))))
587 587
588(defun shr-colorize-region (start end fg &optional bg) 588(defun shr-colorize-region (start end fg &optional bg)
589 (when fg 589 (when (or fg bg)
590 (let ((new-colors (shr-color-check fg bg))) 590 (let ((new-colors (shr-color-check fg bg)))
591 (when new-colors 591 (when new-colors
592 (shr-put-color start end :foreground (cadr new-colors)) 592 (shr-put-color start end :foreground (cadr new-colors))
@@ -633,11 +633,14 @@ ones, in case fg and bg are nil."
633 (let* ((start (point)) 633 (let* ((start (point))
634 (fgcolor (cdr (assq :fgcolor cont))) 634 (fgcolor (cdr (assq :fgcolor cont)))
635 (bgcolor (cdr (assq :bgcolor cont))) 635 (bgcolor (cdr (assq :bgcolor cont)))
636 (shr-stylesheet (list (cons :color fgcolor) 636 (shr-stylesheet (list (cons 'color fgcolor)
637 (cons :background-color bgcolor)))) 637 (cons 'background-color bgcolor))))
638 (shr-generic cont) 638 (shr-generic cont)
639 (shr-colorize-region start (point) fgcolor bgcolor))) 639 (shr-colorize-region start (point) fgcolor bgcolor)))
640 640
641(defun shr-tag-style (cont)
642 )
643
641(defun shr-tag-p (cont) 644(defun shr-tag-p (cont)
642 (shr-ensure-paragraph) 645 (shr-ensure-paragraph)
643 (shr-indent) 646 (shr-indent)
@@ -837,10 +840,14 @@ ones, in case fg and bg are nil."
837 (shr-heading cont 'bold 'underline)) 840 (shr-heading cont 'bold 'underline))
838 841
839(defun shr-tag-font (cont) 842(defun shr-tag-font (cont)
840 (let ((start (point)) 843 (let* ((start (point))
841 (color (cdr (assq :color cont)))) 844 (color (cdr (assq :color cont)))
845 (shr-stylesheet (nconc (list (cons 'color color))
846 shr-stylesheet)))
842 (shr-generic cont) 847 (shr-generic cont)
843 (shr-colorize-region start (point) color))) 848 (when color
849 (shr-colorize-region start (point) color
850 (cdr (assq 'background-color shr-stylesheet))))))
844 851
845;;; Table rendering algorithm. 852;;; Table rendering algorithm.
846 853
@@ -1040,7 +1047,7 @@ ones, in case fg and bg are nil."
1040 (insert cache) 1047 (insert cache)
1041 (let ((shr-width width) 1048 (let ((shr-width width)
1042 (shr-indentation 0)) 1049 (shr-indentation 0))
1043 (shr-generic cont)) 1050 (shr-descend (cons 'td cont)))
1044 (delete-region 1051 (delete-region
1045 (point) 1052 (point)
1046 (+ (point) 1053 (+ (point)