diff options
| author | Katsumi Yamaoka | 2010-10-21 05:36:36 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-10-21 05:36:36 +0000 |
| commit | 3c0663734997699653359bf36dab7a04373594df (patch) | |
| tree | 6389df2355e788f005ef992295ae0233d4fd5193 | |
| parent | d815edf0e616acb8312be815a423a7f489c93814 (diff) | |
| download | emacs-3c0663734997699653359bf36dab7a04373594df.tar.gz emacs-3c0663734997699653359bf36dab7a04373594df.zip | |
shr.el (shr-tag-table): Simplify.
| -rw-r--r-- | lisp/gnus/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/gnus/shr.el | 121 |
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 @@ | |||
| 1 | 2010-10-21 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * shr.el (shr-tag-table): Simplify. | ||
| 4 | |||
| 1 | 2010-10-21 Lars Magne Ingebrigtsen <larsi@gnus.org> | 5 | 2010-10-21 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 6 | ||
| 3 | * gnus-html.el (gnus-html-prefetch-images): Only prefetch http images | 7 | * 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." | |||
| 642 | (nbody (if body (shr-max-columns body))) | 642 | (nbody (if body (shr-max-columns body))) |
| 643 | (nfooter (if footer (shr-max-columns footer)))) | 643 | (nfooter (if footer (shr-max-columns footer)))) |
| 644 | (shr-tag-table-1 | 644 | (shr-tag-table-1 |
| 645 | (if caption | 645 | (nconc |
| 646 | (if header | 646 | (if caption `((tr (td ,@caption)))) |
| 647 | (if footer | 647 | (if header |
| 648 | ;; caption + hader + body + footer | 648 | (if footer |
| 649 | (if (= nheader nbody) | 649 | ;; hader + body + footer |
| 650 | (if (= nbody nfooter) | 650 | (if (= nheader nbody) |
| 651 | `((tr (td ,@caption)) | 651 | (if (= nbody nfooter) |
| 652 | (tr (td (table (tbody ,@header ,@body ,@footer))))) | 652 | `((tr (td (table (tbody ,@header ,@body ,@footer))))) |
| 653 | (if (= nfooter 1) | 653 | (nconc `((tr (td (table (tbody ,@header ,@body))))) |
| 654 | `((tr (td ,@caption)) | 654 | (if (= nfooter 1) |
| 655 | (tr (td (table (tbody ,@header ,@body)))) | 655 | footer |
| 656 | ,@footer) | 656 | `((tr (td (table (tbody ,@footer)))))))) |
| 657 | `((tr (td ,@caption)) | 657 | (nconc `((tr (td (table (tbody ,@header))))) |
| 658 | (tr (td (table (tbody ,@header ,@body)))) | 658 | (if (= nbody nfooter) |
| 659 | (tr (td (table (tbody ,@footer))))))) | 659 | `((tr (td (table (tbody ,@body ,@footer))))) |
| 660 | (if (= nbody nfooter) | 660 | (nconc `((tr (td (table (tbody ,@body))))) |
| 661 | `((tr (td ,@caption)) | 661 | (if (= nfooter 1) |
| 662 | (tr (td (table (tbody ,@header)))) | 662 | footer |
| 663 | (tr (td (table (tbody ,@body ,@footer))))) | 663 | `((tr (td (table (tbody ,@footer)))))))))) |
| 664 | ;; header + body | ||
| 665 | (if (= nheader nbody) | ||
| 666 | `((tr (td (table (tbody ,@header ,@body))))) | ||
| 667 | (if (= nheader 1) | ||
| 668 | `(,@header (tr (td (table (tbody ,@body))))) | ||
| 669 | `((tr (td (table (tbody ,@header)))) | ||
| 670 | (tr (td (table (tbody ,@body)))))))) | ||
| 671 | (if footer | ||
| 672 | ;; body + footer | ||
| 673 | (if (= nbody nfooter) | ||
| 674 | `((tr (td (table (tbody ,@body ,@footer))))) | ||
| 675 | (nconc `((tr (td (table (tbody ,@body))))) | ||
| 664 | (if (= nfooter 1) | 676 | (if (= nfooter 1) |
| 665 | `((tr (td ,@caption)) | 677 | footer |
| 666 | (tr (td (table (tbody ,@header)))) | 678 | `((tr (td (table (tbody ,@footer)))))))) |
| 667 | (tr (td (table (tbody ,@body)))) | 679 | (if caption |
| 668 | ,@footer) | 680 | `((tr (td (table (tbody ,@body))))) |
| 669 | `((tr (td ,@caption)) | 681 | body))))))) |
| 670 | (tr (td (table (tbody ,@header)))) | ||
| 671 | (tr (td (table (tbody ,@body)))) | ||
| 672 | (tr (td (table (tbody ,@footer)))))))) | ||
| 673 | ;; caption + header + body | ||
| 674 | (if (= nheader nbody) | ||
| 675 | `((tr (td ,@caption)) | ||
| 676 | (tr (td (table (tbody ,@header ,@body))))) | ||
| 677 | (if (= nheader 1) | ||
| 678 | `((tr (td ,@caption)) | ||
| 679 | ,@header (tr (td (table (tbody ,@body))))) | ||
| 680 | `((tr (td ,@caption)) | ||
| 681 | (tr (td (table (tbody ,@header)))) | ||
| 682 | (tr (td (table (tbody ,@body)))))))) | ||
| 683 | (if footer | ||
| 684 | ;; caption + body + footer | ||
| 685 | (if (= nbody nfooter) | ||
| 686 | `((tr (td (table (tbody ,@body ,@footer))))) | ||
| 687 | (if (= nfooter 1) | ||
| 688 | `((tr (td (table (tbody ,@body)))) ,@footer) | ||
| 689 | `((tr (td (table (tbody ,@body)))) | ||
| 690 | (tr (td (table (tbody ,@footer))))))) | ||
| 691 | ;; caption + body | ||
| 692 | `((tr (td ,@caption)) | ||
| 693 | (tr (td (table (tbody ,@body))))))) | ||
| 694 | (if header | ||
| 695 | (if footer | ||
| 696 | ;; header + body + footer | ||
| 697 | (if (= nheader nbody) | ||
| 698 | (if (= nbody nfooter) | ||
| 699 | `((tr (td (table (tbody ,@header ,@body ,@footer))))) | ||
| 700 | (if (= nfooter 1) | ||
| 701 | `((tr (td (table (tbody ,@header ,@body)))) | ||
| 702 | ,@footer) | ||
| 703 | `((tr (td (table (tbody ,@header ,@body)))) | ||
| 704 | (tr (td (table (tbody ,@footer))))))) | ||
| 705 | (if (= nbody nfooter) | ||
| 706 | `((tr (td (table (tbody ,@header)))) | ||
| 707 | (tr (td (table (tbody ,@body ,@footer))))) | ||
| 708 | (if (= nfooter 1) | ||
| 709 | `((tr (td (table (tbody ,@header)))) | ||
| 710 | (tr (td (table (tbody ,@body)))) | ||
| 711 | ,@footer) | ||
| 712 | `((tr (td (table (tbody ,@header)))) | ||
| 713 | (tr (td (table (tbody ,@body)))) | ||
| 714 | (tr (td (table (tbody ,@footer)))))))) | ||
| 715 | ;; header + body | ||
| 716 | (if (= nheader nbody) | ||
| 717 | `((tr (td (table (tbody ,@header ,@body))))) | ||
| 718 | (if (= nheader 1) | ||
| 719 | `(,@header (tr (td (table (tbody ,@body))))) | ||
| 720 | `((tr (td (table (tbody ,@header)))) | ||
| 721 | (tr (td (table (tbody ,@body)))))))) | ||
| 722 | (if footer | ||
| 723 | ;; body + footer | ||
| 724 | (if (= nbody nfooter) | ||
| 725 | `((tr (td (table (tbody ,@body ,@footer))))) | ||
| 726 | (if (= nfooter 1) | ||
| 727 | `((tr (td (table (tbody ,@body)))) ,@footer) | ||
| 728 | `((tr (td (table (tbody ,@body)))) | ||
| 729 | (tr (td (table (tbody ,@footer))))))) | ||
| 730 | body)))))) | ||
| 731 | 682 | ||
| 732 | (defun shr-find-elements (cont type) | 683 | (defun shr-find-elements (cont type) |
| 733 | (let (result) | 684 | (let (result) |