changeset 111066:ea124ffc596b

shr.el (shr-tag-table): Fix last change.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 20 Oct 2010 12:24:49 +0000
parents 106c6aef1933
children e36c65ac23bf
files lisp/gnus/shr.el
diffstat 1 files changed, 81 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/shr.el	Wed Oct 20 10:34:58 2010 +0000
+++ b/lisp/gnus/shr.el	Wed Oct 20 12:24:49 2010 +0000
@@ -632,44 +632,92 @@
 	 (nfooter (if footer (shr-max-columns footer))))
     (shr-tag-table-1
      (nconc
-      (if caption `((tr (td ,@caption))))
-      (if header
-	  (if footer
-	      ;; header + body + footer
-	      (if (= nheader nbody)
+      (if caption
+	  (if header
+	      (if footer
+		  ;; caption + hader + body + footer
+		  (if (= nheader nbody)
+		      (if (= nbody nfooter)
+			  `((tr (td ,@caption))
+			    (tr (td (table (tbody ,@header ,@body ,@footer)))))
+			(if (= nfooter 1)
+			    `((tr (td ,@caption))
+			      (tr (td (table (tbody ,@header ,@body))))
+			      ,@footer)
+			  `((tr (td ,@caption))
+			    (tr (td (table (tbody ,@header ,@body))))
+			    (tr (td (table (tbody ,@footer)))))))
+		    (if (= nbody nfooter)
+			`((tr (td ,@caption))
+			  (tr (td (table (tbody ,@header))))
+			  (tr (td (table (tbody ,@body ,@footer)))))
+		      (if (= nfooter 1)
+			  `((tr (td ,@caption))
+			    (tr (td (table (tbody ,@header))))
+			    (tr (td (table (tbody ,@body))))
+			    ,@footer)
+			`((tr (td ,@caption))
+			  (tr (td (table (tbody ,@header))))
+			  (tr (td (table (tbody ,@body))))
+			  (tr (td (table (tbody ,@footer))))))))
+		;; caption + header + body
+		(if (= nheader nbody)
+		    `((tr (td ,@caption))
+		      (tr (td (table (tbody ,@header ,@body)))))
+		  (if (= nheader 1)
+		      `((tr (td ,@caption))
+			,@header (tr (td (table (tbody ,@body)))))
+		    `((tr (td ,@caption))
+		      (tr (td (table (tbody ,@header))))
+		      (tr (td (table (tbody ,@body))))))))
+	    (if footer
+		;; caption + body + footer
+		(if (= nbody nfooter)
+		    `((tr (td (table (tbody ,@body ,@footer)))))
+		  (if (= nfooter 1)
+		      `((tr (td (table (tbody ,@body)))) ,@footer)
+		    `((tr (td (table (tbody ,@body))))
+		      (tr (td (table (tbody ,@footer)))))))
+	      ;; caption + body
+	      `((tr (td ,@caption))
+		(tr (td (table (tbody ,@body)))))))
+	(if header
+	    (if footer
+		;; header + body + footer
+		(if (= nheader nbody)
+		    (if (= nbody nfooter)
+			`((tr (td (table (tbody ,@header ,@body ,@footer)))))
+		      (if (= nfooter 1)
+			  `((tr (td (table (tbody ,@header ,@body))))
+			    ,@footer)
+			`((tr (td (table (tbody ,@header ,@body))))
+			  (tr (td (table (tbody ,@footer)))))))
 		  (if (= nbody nfooter)
-		      `((tr (td (table (tbody ,@header ,@body ,@footer)))))
+		      `((tr (td (table (tbody ,@header))))
+			(tr (td (table (tbody ,@body ,@footer)))))
 		    (if (= nfooter 1)
-			`((tr (td (table (tbody ,@header ,@body))))
+			`((tr (td (table (tbody ,@header))))
+			  (tr (td (table (tbody ,@body))))
 			  ,@footer)
-		      `((tr (td (table (tbody ,@header ,@body))))
-			(tr (td (table (tbody ,@footer)))))))
-		(if (= nbody nfooter)
-		    `((tr (td (table (tbody ,@header))))
-		      (tr (td (table (tbody ,@body ,@footer)))))
-		  (if (= nfooter 1)
 		      `((tr (td (table (tbody ,@header))))
 			(tr (td (table (tbody ,@body))))
-			,@footer)
-		    `((tr (td (table (tbody ,@header))))
-		      (tr (td (table (tbody ,@body))))
-		      (tr (td (table (tbody ,@footer))))))))
-	    ;; header + body
-	    (if (= nheader nbody)
-		`((tr (td (table (tbody ,@header ,@body)))))
-	      (if (= nheader 1)
-		  `(,@header (tr (td (table (tbody ,@body)))))
-		`((tr (td (table (tbody ,@header))))
-		  (tr (td (table (tbody ,@body))))))))
-	(if footer
-	    ;; body + footer
-	    (if (= nbody nfooter)
-		`((tr (td (table (tbody ,@body ,@footer)))))
-	      (if (= nfooter 1)
-		  `((tr (td (table (tbody ,@body)))) ,@footer)
-		`((tr (td (table (tbody ,@body))))
-		  (tr (td (table (tbody ,@footer)))))))
-	  body))))))
+			(tr (td (table (tbody ,@footer))))))))
+	      ;; header + body
+	      (if (= nheader nbody)
+		  `((tr (td (table (tbody ,@header ,@body)))))
+		(if (= nheader 1)
+		    `(,@header (tr (td (table (tbody ,@body)))))
+		  `((tr (td (table (tbody ,@header))))
+		    (tr (td (table (tbody ,@body))))))))
+	  (if footer
+	      ;; body + footer
+	      (if (= nbody nfooter)
+		  `((tr (td (table (tbody ,@body ,@footer)))))
+		(if (= nfooter 1)
+		    `((tr (td (table (tbody ,@body)))) ,@footer)
+		  `((tr (td (table (tbody ,@body))))
+		    (tr (td (table (tbody ,@footer)))))))
+	    body)))))))
 
 (defun shr-find-elements (cont type)
   (let (result)