summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2010-10-21 05:36:36 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-10-21 05:36:36 +0000
commit3c0663734997699653359bf36dab7a04373594df (patch)
tree6389df2355e788f005ef992295ae0233d4fd5193 /lisp
parentd815edf0e616acb8312be815a423a7f489c93814 (diff)
shr.el (shr-tag-table): Simplify.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/shr.el121
2 files changed, 40 insertions, 85 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 1c3708e9526..7236a164ab8 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * shr.el (shr-tag-table): Simplify.
+
2010-10-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-html.el (gnus-html-prefetch-images): Only prefetch http images
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 9645f04e0a4..a25fc2c262a 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -642,92 +642,43 @@ Return a string with image data."
(nbody (if body (shr-max-columns body)))
(nfooter (if footer (shr-max-columns footer))))
(shr-tag-table-1
- (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)))))
+ (nconc
+ (if caption `((tr (td ,@caption))))
+ (if header
+ (if footer
+ ;; hader + body + footer
+ (if (= nheader nbody)
+ (if (= nbody nfooter)
+ `((tr (td (table (tbody ,@header ,@body ,@footer)))))
+ (nconc `((tr (td (table (tbody ,@header ,@body)))))
+ (if (= nfooter 1)
+ footer
+ `((tr (td (table (tbody ,@footer))))))))
+ (nconc `((tr (td (table (tbody ,@header)))))
+ (if (= nbody nfooter)
+ `((tr (td (table (tbody ,@body ,@footer)))))
+ (nconc `((tr (td (table (tbody ,@body)))))
+ (if (= nfooter 1)
+ footer
+ `((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)))))
+ (nconc `((tr (td (table (tbody ,@body)))))
(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))))
- (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))))))
+ footer
+ `((tr (td (table (tbody ,@footer))))))))
+ (if caption
+ `((tr (td (table (tbody ,@body)))))
+ body)))))))
(defun shr-find-elements (cont type)
(let (result)