diff options
| author | Gnus developers | 2010-10-20 22:29:38 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-10-20 22:29:38 +0000 |
| commit | 2526f423795632d123f3cd99e9aa45065b41745b (patch) | |
| tree | 8796b5340305c0fbba5ab323cedb6ee4e369af2c | |
| parent | 4bfb8dec36751543c5ba254d8a69685d39295615 (diff) | |
| download | emacs-2526f423795632d123f3cd99e9aa45065b41745b.tar.gz emacs-2526f423795632d123f3cd99e9aa45065b41745b.zip | |
Merge changes made in Gnus trunk.
nnimap.el (nnimap-insert-partial-structure): Fix boundary detection.
spam.el (spam-list-of-processors): Mark as obsolete.
gnus-art.el (gnus-blocked-images): New function. Allow the `gnus-blocked-images' to be a function.
gnus-art.el (gnus-article-wash-function): Remove it, and use `mm-text-html-renderer' instead.
mm-decode.el (mm-inline-text-html-renderer): Removed.
mm-decode.el (mm-inline-media-tests): Removed use.
mm-view.el (mm-inline-text-html): Removed use.
mm-view.el (mm-text-html-renderer-alist): Add the `shr' and `gnus-w3m' symbols.
gnus.texi (Article Washing): shr and gnus-w3m, not the direct function names.
gnus-art.el (article-wash-html): Simplify and remove the charset stuff. Use the normal html rendering code instead of the special html washing code.
mm-view.el (mm-text-html-washer-alist): Removed.
gnus-news.texi: Mention that mm-text-html-renderer is the only HTML variable now.
shr.el (shr-tag-table): Remove useless nconc.
| -rw-r--r-- | doc/misc/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/misc/gnus-news.texi | 3 | ||||
| -rw-r--r-- | doc/misc/gnus.texi | 22 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 27 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 144 | ||||
| -rw-r--r-- | lisp/gnus/gnus-html.el | 6 | ||||
| -rw-r--r-- | lisp/gnus/mm-decode.el | 19 | ||||
| -rw-r--r-- | lisp/gnus/mm-view.el | 24 | ||||
| -rw-r--r-- | lisp/gnus/nnimap.el | 6 | ||||
| -rw-r--r-- | lisp/gnus/nnrss.el | 1 | ||||
| -rw-r--r-- | lisp/gnus/shr.el | 173 | ||||
| -rw-r--r-- | lisp/gnus/spam.el | 1 |
12 files changed, 182 insertions, 250 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 1737ce35703..2272f6a3296 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-10-20 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * gnus.texi (HTML): Document the function value of | ||
| 4 | gnus-blocked-images. | ||
| 5 | (Article Washing): shr and gnus-w3m, not the direct function names. | ||
| 6 | |||
| 1 | 2010-10-20 Julien Danjou <julien@danjou.info> | 7 | 2010-10-20 Julien Danjou <julien@danjou.info> |
| 2 | 8 | ||
| 3 | * emacs-mime.texi (Flowed text): Add a note about mml-enable-flowed | 9 | * emacs-mime.texi (Flowed text): Add a note about mml-enable-flowed |
diff --git a/doc/misc/gnus-news.texi b/doc/misc/gnus-news.texi index 1136d52e51d..19483f51426 100644 --- a/doc/misc/gnus-news.texi +++ b/doc/misc/gnus-news.texi | |||
| @@ -124,6 +124,9 @@ Customization}. | |||
| 124 | 124 | ||
| 125 | @itemize @bullet | 125 | @itemize @bullet |
| 126 | 126 | ||
| 127 | @item There's now only one variable that determines how @acronym{HTML} | ||
| 128 | is rendered: @code{mm-text-html-renderer}. | ||
| 129 | |||
| 127 | @item Gnus now supports sticky article buffers. Those are article buffers | 130 | @item Gnus now supports sticky article buffers. Those are article buffers |
| 128 | that are not reused when you select another article. @xref{Sticky | 131 | that are not reused when you select another article. @xref{Sticky |
| 129 | Articles}. | 132 | Articles}. |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 39693204da3..2cd45b4f2e0 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -9803,19 +9803,16 @@ If a prefix is given, a charset will be asked for. If it is a number, | |||
| 9803 | the charset defined in @code{gnus-summary-show-article-charset-alist} | 9803 | the charset defined in @code{gnus-summary-show-article-charset-alist} |
| 9804 | (@pxref{Paging the Article}) will be used. | 9804 | (@pxref{Paging the Article}) will be used. |
| 9805 | 9805 | ||
| 9806 | @vindex gnus-article-wash-function | ||
| 9807 | The default is to use the function specified by | 9806 | The default is to use the function specified by |
| 9808 | @code{mm-text-html-renderer} (@pxref{Display Customization, ,Display | 9807 | @code{mm-text-html-renderer} (@pxref{Display Customization, ,Display |
| 9809 | Customization, emacs-mime, The Emacs MIME Manual}) to convert the | 9808 | Customization, emacs-mime, The Emacs MIME Manual}) to convert the |
| 9810 | @acronym{HTML}, but this is controlled by the | 9809 | @acronym{HTML}. Pre-defined functions you can use include: |
| 9811 | @code{gnus-article-wash-function} variable. Pre-defined functions you | ||
| 9812 | can use include: | ||
| 9813 | 9810 | ||
| 9814 | @table @code | 9811 | @table @code |
| 9815 | @item mm-shr | 9812 | @item shr |
| 9816 | Use Gnus simple html renderer. | 9813 | Use Gnus simple html renderer. |
| 9817 | 9814 | ||
| 9818 | @item gnus-article-html | 9815 | @item gnus-w3m |
| 9819 | Use Gnus rendered based on w3m. | 9816 | Use Gnus rendered based on w3m. |
| 9820 | 9817 | ||
| 9821 | @item w3 | 9818 | @item w3 |
| @@ -12462,15 +12459,20 @@ that's based on @code{w3m}. | |||
| 12462 | 12459 | ||
| 12463 | @item gnus-blocked-images | 12460 | @item gnus-blocked-images |
| 12464 | @vindex gnus-blocked-images | 12461 | @vindex gnus-blocked-images |
| 12465 | Images that have @acronym{URL}s that match this regexp won't be | 12462 | External images that have @acronym{URL}s that match this regexp won't |
| 12466 | fetched and displayed. For instance, do block all @acronym{URL}s that | 12463 | be fetched and displayed. For instance, do block all @acronym{URL}s |
| 12467 | have the string ``ads'' in them, do the following: | 12464 | that have the string ``ads'' in them, do the following: |
| 12468 | 12465 | ||
| 12469 | @lisp | 12466 | @lisp |
| 12470 | (setq gnus-blocked-images "ads") | 12467 | (setq gnus-blocked-images "ads") |
| 12471 | @end lisp | 12468 | @end lisp |
| 12472 | 12469 | ||
| 12473 | The default is to block all external images. | 12470 | This can also be a function to be evaluated. If so, it will be |
| 12471 | called with the group name as the parameter. The default value is | ||
| 12472 | @code{gnus-block-private-groups}, which will return @samp{"."} for | ||
| 12473 | anything that isn't a newsgroup. This means that no external images | ||
| 12474 | will be fetched as a result of reading mail, so that nobody can use | ||
| 12475 | web bugs (and the like) to track whether you've read email. | ||
| 12474 | 12476 | ||
| 12475 | @item gnus-html-cache-directory | 12477 | @item gnus-html-cache-directory |
| 12476 | @vindex gnus-html-cache-directory | 12478 | @vindex gnus-html-cache-directory |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index fc005614634..235fc71943d 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,6 +1,33 @@ | |||
| 1 | 2010-10-20 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * shr.el (shr-tag-table): Remove useless nconc. | ||
| 4 | |||
| 5 | 2010-10-20 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 6 | |||
| 7 | * gnus-art.el (article-wash-html): Simplify and remove the charset | ||
| 8 | stuff. Use the normal html rendering code instead of the special html | ||
| 9 | washing code. | ||
| 10 | |||
| 11 | * mm-view.el (mm-text-html-renderer-alist): Add the `shr' and | ||
| 12 | `gnus-w3m' symbols. | ||
| 13 | (mm-text-html-washer-alist): Removed. | ||
| 14 | |||
| 15 | * mm-decode.el (mm-inline-text-html-renderer): Removed. | ||
| 16 | (mm-inline-media-tests): Removed use. | ||
| 17 | (mm-text-html-renderer): Change default to the `shr' symbol. | ||
| 18 | |||
| 19 | * mm-view.el (mm-inline-text-html): Removed use. | ||
| 20 | |||
| 21 | * gnus-art.el (gnus-blocked-images): New function. Allow the | ||
| 22 | `gnus-blocked-images' to be a function. | ||
| 23 | (gnus-article-wash-function): Removed. | ||
| 24 | |||
| 1 | 2010-10-20 Julien Danjou <julien@danjou.info> | 25 | 2010-10-20 Julien Danjou <julien@danjou.info> |
| 2 | 26 | ||
| 27 | * spam.el (spam-list-of-processors): Mark as obsolete. | ||
| 28 | |||
| 3 | * nnimap.el (nnimap-request-article): Fix BODYSTRUCTURE retrieval. | 29 | * nnimap.el (nnimap-request-article): Fix BODYSTRUCTURE retrieval. |
| 30 | (nnimap-insert-partial-structure): Fix boundary detection. | ||
| 4 | 31 | ||
| 5 | 2010-10-20 Andreas Seltenreich <seltenreich@gmx.de> | 32 | 2010-10-20 Andreas Seltenreich <seltenreich@gmx.de> |
| 6 | 33 | ||
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 537ae4da8aa..530e72ff5ea 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -1621,9 +1621,6 @@ It is a string, such as \"PGP\". If nil, ask user." | |||
| 1621 | :type 'string | 1621 | :type 'string |
| 1622 | :group 'mime-security) | 1622 | :group 'mime-security) |
| 1623 | 1623 | ||
| 1624 | (defvar gnus-article-wash-function nil | ||
| 1625 | "Function used for converting HTML into text.") | ||
| 1626 | |||
| 1627 | (defcustom gnus-use-idna (and (condition-case nil (require 'idna) (file-error)) | 1624 | (defcustom gnus-use-idna (and (condition-case nil (require 'idna) (file-error)) |
| 1628 | (mm-coding-system-p 'utf-8) | 1625 | (mm-coding-system-p 'utf-8) |
| 1629 | (executable-find idna-program)) | 1626 | (executable-find idna-program)) |
| @@ -1639,8 +1636,11 @@ This requires GNU Libidn, and by default only enabled if it is found." | |||
| 1639 | :group 'gnus-article | 1636 | :group 'gnus-article |
| 1640 | :type 'boolean) | 1637 | :type 'boolean) |
| 1641 | 1638 | ||
| 1642 | (defcustom gnus-blocked-images "." | 1639 | (defcustom gnus-blocked-images 'gnus-block-private-groups |
| 1643 | "Images that have URLs matching this regexp will be blocked." | 1640 | "Images that have URLs matching this regexp will be blocked. |
| 1641 | This can also be a function to be evaluated. If so, it will be | ||
| 1642 | called with the group name as the parameter, and should return a | ||
| 1643 | regexp." | ||
| 1644 | :version "24.1" | 1644 | :version "24.1" |
| 1645 | :group 'gnus-art | 1645 | :group 'gnus-art |
| 1646 | :type 'regexp) | 1646 | :type 'regexp) |
| @@ -2694,118 +2694,16 @@ If READ-CHARSET, ask for a coding system." | |||
| 2694 | (when (interactive-p) | 2694 | (when (interactive-p) |
| 2695 | (gnus-treat-article nil)))) | 2695 | (gnus-treat-article nil)))) |
| 2696 | 2696 | ||
| 2697 | 2697 | (defun article-wash-html () | |
| 2698 | (defun article-wash-html (&optional read-charset) | 2698 | "Format an HTML article." |
| 2699 | "Format an HTML article. | 2699 | (interactive) |
| 2700 | If READ-CHARSET, ask for a coding system. If it is a number, the | 2700 | (let ((handles nil) |
| 2701 | charset defined in `gnus-summary-show-article-charset-alist' is used." | 2701 | (buffer-read-only nil)) |
| 2702 | (interactive "P") | 2702 | (when (gnus-buffer-live-p gnus-original-article-buffer) |
| 2703 | (save-excursion | 2703 | (setq handles (mm-dissect-buffer t t))) |
| 2704 | (let ((inhibit-read-only t) | 2704 | (article-goto-body) |
| 2705 | charset) | 2705 | (delete-region (point) (point-max)) |
| 2706 | (if read-charset | 2706 | (mm-inline-text-html handles))) |
| 2707 | (if (or (and (numberp read-charset) | ||
| 2708 | (setq charset | ||
| 2709 | (cdr | ||
| 2710 | (assq read-charset | ||
| 2711 | gnus-summary-show-article-charset-alist)))) | ||
| 2712 | (setq charset (mm-read-coding-system "Charset: "))) | ||
| 2713 | (let ((gnus-summary-show-article-charset-alist | ||
| 2714 | (list (cons 1 charset)))) | ||
| 2715 | (with-current-buffer gnus-summary-buffer | ||
| 2716 | (gnus-summary-show-article 1))) | ||
| 2717 | (error "No charset is given")) | ||
| 2718 | (when (gnus-buffer-live-p gnus-original-article-buffer) | ||
| 2719 | (with-current-buffer gnus-original-article-buffer | ||
| 2720 | (let* ((ct (gnus-fetch-field "content-type")) | ||
| 2721 | (ctl (and ct (mail-header-parse-content-type ct)))) | ||
| 2722 | (setq charset (and ctl | ||
| 2723 | (mail-content-type-get ctl 'charset))) | ||
| 2724 | (when (stringp charset) | ||
| 2725 | (setq charset (intern (downcase charset))))))) | ||
| 2726 | (unless charset | ||
| 2727 | (setq charset gnus-newsgroup-charset))) | ||
| 2728 | (article-goto-body) | ||
| 2729 | (save-window-excursion | ||
| 2730 | (save-restriction | ||
| 2731 | (narrow-to-region (point) (point-max)) | ||
| 2732 | (let* ((func (or gnus-article-wash-function mm-text-html-renderer)) | ||
| 2733 | (entry (assq func mm-text-html-washer-alist))) | ||
| 2734 | (when entry | ||
| 2735 | (setq func (cdr entry))) | ||
| 2736 | (cond | ||
| 2737 | ((functionp func) | ||
| 2738 | (funcall func)) | ||
| 2739 | (t | ||
| 2740 | (apply (car func) (cdr func)))))))))) | ||
| 2741 | |||
| 2742 | ;; External. | ||
| 2743 | (declare-function w3-region "ext:w3-display" (st nd)) | ||
| 2744 | |||
| 2745 | (defun gnus-article-wash-html-with-w3 () | ||
| 2746 | "Wash the current buffer with w3." | ||
| 2747 | (mm-setup-w3) | ||
| 2748 | (let ((w3-strict-width (window-width)) | ||
| 2749 | (url-standalone-mode t) | ||
| 2750 | (url-gateway-unplugged t) | ||
| 2751 | (w3-honor-stylesheets nil)) | ||
| 2752 | (condition-case () | ||
| 2753 | (w3-region (point-min) (point-max)) | ||
| 2754 | (error)))) | ||
| 2755 | |||
| 2756 | ;; External. | ||
| 2757 | (declare-function w3m-region "ext:w3m" (start end &optional url charset)) | ||
| 2758 | |||
| 2759 | (defun gnus-article-wash-html-with-w3m () | ||
| 2760 | "Wash the current buffer with emacs-w3m." | ||
| 2761 | (mm-setup-w3m) | ||
| 2762 | (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp) | ||
| 2763 | w3m-force-redisplay) | ||
| 2764 | (w3m-region (point-min) (point-max))) | ||
| 2765 | ;; Put the mark meaning this part was rendered by emacs-w3m. | ||
| 2766 | (put-text-property (point-min) (point-max) 'mm-inline-text-html-with-w3m t) | ||
| 2767 | (when (and mm-inline-text-html-with-w3m-keymap | ||
| 2768 | (boundp 'w3m-minor-mode-map) | ||
| 2769 | w3m-minor-mode-map) | ||
| 2770 | (if (and (boundp 'w3m-link-map) | ||
| 2771 | w3m-link-map) | ||
| 2772 | (let* ((start (point-min)) | ||
| 2773 | (end (point-max)) | ||
| 2774 | (on (get-text-property start 'w3m-href-anchor)) | ||
| 2775 | (map (copy-keymap w3m-link-map)) | ||
| 2776 | next) | ||
| 2777 | (set-keymap-parent map w3m-minor-mode-map) | ||
| 2778 | (while (< start end) | ||
| 2779 | (if on | ||
| 2780 | (progn | ||
| 2781 | (setq next (or (text-property-any start end | ||
| 2782 | 'w3m-href-anchor nil) | ||
| 2783 | end)) | ||
| 2784 | (put-text-property start next 'keymap map)) | ||
| 2785 | (setq next (or (text-property-not-all start end | ||
| 2786 | 'w3m-href-anchor nil) | ||
| 2787 | end)) | ||
| 2788 | (put-text-property start next 'keymap w3m-minor-mode-map)) | ||
| 2789 | (setq start next | ||
| 2790 | on (not on)))) | ||
| 2791 | (put-text-property (point-min) (point-max) 'keymap w3m-minor-mode-map)))) | ||
| 2792 | |||
| 2793 | (defvar charset) ;; Bound by `article-wash-html'. | ||
| 2794 | |||
| 2795 | (defun gnus-article-wash-html-with-w3m-standalone () | ||
| 2796 | "Wash the current buffer with w3m." | ||
| 2797 | (if (mm-w3m-standalone-supports-m17n-p) | ||
| 2798 | (progn | ||
| 2799 | (unless (mm-coding-system-p charset) ;; Bound by `article-wash-html'. | ||
| 2800 | ;; The default. | ||
| 2801 | (setq charset 'iso-8859-1)) | ||
| 2802 | (let ((coding-system-for-write charset) | ||
| 2803 | (coding-system-for-read charset)) | ||
| 2804 | (call-process-region | ||
| 2805 | (point-min) (point-max) | ||
| 2806 | "w3m" t t nil "-dump" "-T" "text/html" | ||
| 2807 | "-I" (symbol-name charset) "-O" (symbol-name charset)))) | ||
| 2808 | (mm-inline-wash-with-stdin nil "w3m" "-dump" "-T" "text/html"))) | ||
| 2809 | 2707 | ||
| 2810 | (defvar gnus-article-browse-html-temp-list nil | 2708 | (defvar gnus-article-browse-html-temp-list nil |
| 2811 | "List of temporary files created by `gnus-article-browse-html-parts'. | 2709 | "List of temporary files created by `gnus-article-browse-html-parts'. |
| @@ -6896,6 +6794,18 @@ If given a prefix, show the hidden text instead." | |||
| 6896 | (point)) | 6794 | (point)) |
| 6897 | (set-buffer buf)))))) | 6795 | (set-buffer buf)))))) |
| 6898 | 6796 | ||
| 6797 | (defun gnus-block-private-groups (group) | ||
| 6798 | (if (gnus-news-group-p group) | ||
| 6799 | ;; Block nothing in news groups. | ||
| 6800 | nil | ||
| 6801 | ;; Block everything anywhere else. | ||
| 6802 | ".")) | ||
| 6803 | |||
| 6804 | (defun gnus-blocked-images () | ||
| 6805 | (if (functionp gnus-blocked-images) | ||
| 6806 | (funcall gnus-blocked-images gnus-newsgroup-name) | ||
| 6807 | gnus-blocked-images)) | ||
| 6808 | |||
| 6899 | ;;; | 6809 | ;;; |
| 6900 | ;;; Article editing | 6810 | ;;; Article editing |
| 6901 | ;;; | 6811 | ;;; |
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index c1472118cf8..861ad73d089 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el | |||
| @@ -205,8 +205,8 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")." | |||
| 205 | url | 205 | url |
| 206 | (if (buffer-live-p gnus-summary-buffer) | 206 | (if (buffer-live-p gnus-summary-buffer) |
| 207 | (with-current-buffer gnus-summary-buffer | 207 | (with-current-buffer gnus-summary-buffer |
| 208 | gnus-blocked-images) | 208 | (gnus-blocked-images)) |
| 209 | gnus-blocked-images)) | 209 | (gnus-blocked-images))) |
| 210 | (progn | 210 | (progn |
| 211 | (widget-convert-button | 211 | (widget-convert-button |
| 212 | 'link start end | 212 | 'link start end |
| @@ -491,7 +491,7 @@ This only works if the article in question is HTML." | |||
| 491 | (defun gnus-html-prefetch-images (summary) | 491 | (defun gnus-html-prefetch-images (summary) |
| 492 | (when (buffer-live-p summary) | 492 | (when (buffer-live-p summary) |
| 493 | (let ((blocked-images (with-current-buffer summary | 493 | (let ((blocked-images (with-current-buffer summary |
| 494 | gnus-blocked-images))) | 494 | (gnus-blocked-images)))) |
| 495 | (save-match-data | 495 | (save-match-data |
| 496 | (while (re-search-forward "<img[^>]+src=[\"']\\([^\"']+\\)" nil t) | 496 | (while (re-search-forward "<img[^>]+src=[\"']\\([^\"']+\\)" nil t) |
| 497 | (let ((url (gnus-html-encode-url (match-string 1)))) | 497 | (let ((url (gnus-html-encode-url (match-string 1)))) |
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index d35319e151b..5b79b20eb8d 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -105,8 +105,8 @@ | |||
| 105 | ,disposition ,description ,cache ,id)) | 105 | ,disposition ,description ,cache ,id)) |
| 106 | 106 | ||
| 107 | (defcustom mm-text-html-renderer | 107 | (defcustom mm-text-html-renderer |
| 108 | (cond ((fboundp 'libxml-parse-html-region) 'mm-shr) | 108 | (cond ((fboundp 'libxml-parse-html-region) 'shr) |
| 109 | ((executable-find "w3m") 'gnus-article-html) | 109 | ((executable-find "w3m") 'gnus-w3m) |
| 110 | ((executable-find "links") 'links) | 110 | ((executable-find "links") 'links) |
| 111 | ((executable-find "lynx") 'lynx) | 111 | ((executable-find "lynx") 'lynx) |
| 112 | ((locate-library "w3") 'w3) | 112 | ((locate-library "w3") 'w3) |
| @@ -115,8 +115,8 @@ | |||
| 115 | "Render of HTML contents. | 115 | "Render of HTML contents. |
| 116 | It is one of defined renderer types, or a rendering function. | 116 | It is one of defined renderer types, or a rendering function. |
| 117 | The defined renderer types are: | 117 | The defined renderer types are: |
| 118 | `mm-shr': use Gnus simple HTML renderer; | 118 | `shr': use Gnus simple HTML renderer; |
| 119 | `gnus-article-html' : use Gnus renderer based on w3m; | 119 | `gnus-w3m' : use Gnus renderer based on w3m; |
| 120 | `w3m' : use emacs-w3m; | 120 | `w3m' : use emacs-w3m; |
| 121 | `w3m-standalone': use w3m; | 121 | `w3m-standalone': use w3m; |
| 122 | `links': use links; | 122 | `links': use links; |
| @@ -125,8 +125,8 @@ The defined renderer types are: | |||
| 125 | `html2text' : use html2text; | 125 | `html2text' : use html2text; |
| 126 | nil : use external viewer (default web browser)." | 126 | nil : use external viewer (default web browser)." |
| 127 | :version "24.1" | 127 | :version "24.1" |
| 128 | :type '(choice (const mm-shr) | 128 | :type '(choice (const shr) |
| 129 | (const gnus-article-html) | 129 | (const gnus-w3m) |
| 130 | (const w3) | 130 | (const w3) |
| 131 | (const w3m :tag "emacs-w3m") | 131 | (const w3m :tag "emacs-w3m") |
| 132 | (const w3m-standalone :tag "standalone w3m" ) | 132 | (const w3m-standalone :tag "standalone w3m" ) |
| @@ -137,10 +137,6 @@ nil : use external viewer (default web browser)." | |||
| 137 | (function)) | 137 | (function)) |
| 138 | :group 'mime-display) | 138 | :group 'mime-display) |
| 139 | 139 | ||
| 140 | (defvar mm-inline-text-html-renderer nil | ||
| 141 | "Function used for rendering inline HTML contents. | ||
| 142 | It is suggested to customize `mm-text-html-renderer' instead.") | ||
| 143 | |||
| 144 | (defcustom mm-inline-text-html-with-images nil | 140 | (defcustom mm-inline-text-html-with-images nil |
| 145 | "If non-nil, Gnus will allow retrieving images in HTML contents with | 141 | "If non-nil, Gnus will allow retrieving images in HTML contents with |
| 146 | the <img> tags. It has no effect on Emacs/w3. See also the | 142 | the <img> tags. It has no effect on Emacs/w3. See also the |
| @@ -245,8 +241,7 @@ before the external MIME handler is invoked." | |||
| 245 | ("text/html" | 241 | ("text/html" |
| 246 | mm-inline-text-html | 242 | mm-inline-text-html |
| 247 | (lambda (handle) | 243 | (lambda (handle) |
| 248 | (or mm-inline-text-html-renderer | 244 | mm-text-html-renderer)) |
| 249 | mm-text-html-renderer))) | ||
| 250 | ("text/x-vcard" | 245 | ("text/x-vcard" |
| 251 | mm-inline-text-vcard | 246 | mm-inline-text-vcard |
| 252 | (lambda (handle) | 247 | (lambda (handle) |
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 11e475d21ec..abe761ba9f9 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -50,29 +50,19 @@ | |||
| 50 | (defvar w3m-minor-mode-map) | 50 | (defvar w3m-minor-mode-map) |
| 51 | 51 | ||
| 52 | (defvar mm-text-html-renderer-alist | 52 | (defvar mm-text-html-renderer-alist |
| 53 | '((w3 . mm-inline-text-html-render-with-w3) | 53 | '((shr . mm-shr) |
| 54 | (w3 . mm-inline-text-html-render-with-w3) | ||
| 54 | (w3m . mm-inline-text-html-render-with-w3m) | 55 | (w3m . mm-inline-text-html-render-with-w3m) |
| 55 | (w3m-standalone . mm-inline-text-html-render-with-w3m-standalone) | 56 | (w3m-standalone . mm-inline-text-html-render-with-w3m-standalone) |
| 57 | (gnus-w3m . gnus-article-html) | ||
| 56 | (links mm-inline-render-with-file | 58 | (links mm-inline-render-with-file |
| 57 | mm-links-remove-leading-blank | 59 | mm-links-remove-leading-blank |
| 58 | "links" "-dump" file) | 60 | "links" "-dump" file) |
| 59 | (lynx mm-inline-render-with-stdin nil | 61 | (lynx mm-inline-render-with-stdin nil |
| 60 | "lynx" "-dump" "-force_html" "-stdin" "-nolist") | 62 | "lynx" "-dump" "-force_html" "-stdin" "-nolist") |
| 61 | (html2text mm-inline-render-with-function html2text)) | 63 | (html2text mm-inline-render-with-function html2text)) |
| 62 | "The attributes of renderer types for text/html.") | 64 | "The attributes of renderer types for text/html.") |
| 63 | 65 | ||
| 64 | (defvar mm-text-html-washer-alist | ||
| 65 | '((w3 . gnus-article-wash-html-with-w3) | ||
| 66 | (w3m . gnus-article-wash-html-with-w3m) | ||
| 67 | (w3m-standalone . gnus-article-wash-html-with-w3m-standalone) | ||
| 68 | (links mm-inline-wash-with-file | ||
| 69 | mm-links-remove-leading-blank | ||
| 70 | "links" "-dump" file) | ||
| 71 | (lynx mm-inline-wash-with-stdin nil | ||
| 72 | "lynx" "-dump" "-force_html" "-stdin" "-nolist") | ||
| 73 | (html2text html2text)) | ||
| 74 | "The attributes of washer types for text/html.") | ||
| 75 | |||
| 76 | (defcustom mm-fill-flowed t | 66 | (defcustom mm-fill-flowed t |
| 77 | "If non-nil a format=flowed article will be displayed flowed." | 67 | "If non-nil a format=flowed article will be displayed flowed." |
| 78 | :type 'boolean | 68 | :type 'boolean |
| @@ -426,7 +416,7 @@ | |||
| 426 | (buffer-string))))) | 416 | (buffer-string))))) |
| 427 | 417 | ||
| 428 | (defun mm-inline-text-html (handle) | 418 | (defun mm-inline-text-html (handle) |
| 429 | (let* ((func (or mm-inline-text-html-renderer mm-text-html-renderer)) | 419 | (let* ((func mm-text-html-renderer) |
| 430 | (entry (assq func mm-text-html-renderer-alist)) | 420 | (entry (assq func mm-text-html-renderer-alist)) |
| 431 | (inhibit-read-only t)) | 421 | (inhibit-read-only t)) |
| 432 | (if entry | 422 | (if entry |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 5e4e051a4ce..d6ad40eeae8 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -565,9 +565,9 @@ textual parts.") | |||
| 565 | (pop bstruc)) | 565 | (pop bstruc)) |
| 566 | (setq type (car bstruc)) | 566 | (setq type (car bstruc)) |
| 567 | (setq bstruc (car (cdr bstruc))) | 567 | (setq bstruc (car (cdr bstruc))) |
| 568 | (when (and (stringp (car bstruc)) | 568 | (let ((has-boundary (member "boundary" bstruc))) |
| 569 | (string= (downcase (car bstruc)) "boundary")) | 569 | (when has-boundary |
| 570 | (setq boundary (cadr bstruc)))) | 570 | (setq boundary (cadr has-boundary))))) |
| 571 | (when subp | 571 | (when subp |
| 572 | (insert (format "Content-type: multipart/%s; boundary=%S\n\n" | 572 | (insert (format "Content-type: multipart/%s; boundary=%S\n\n" |
| 573 | (downcase type) boundary))) | 573 | (downcase type) boundary))) |
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index ebe8c514cb3..e3ce6db7c56 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el | |||
| @@ -198,7 +198,6 @@ used to render text. If it is nil, text will simply be folded.") | |||
| 198 | t) | 198 | t) |
| 199 | 199 | ||
| 200 | (defvar mm-text-html-renderer) | 200 | (defvar mm-text-html-renderer) |
| 201 | (defvar mm-text-html-washer-alist) | ||
| 202 | 201 | ||
| 203 | (deffoo nnrss-request-article (article &optional group server buffer) | 202 | (deffoo nnrss-request-article (article &optional group server buffer) |
| 204 | (setq group (nnrss-decode-group-name group)) | 203 | (setq group (nnrss-decode-group-name group)) |
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index e632b689a3f..acf47aa254a 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el | |||
| @@ -631,93 +631,92 @@ Return a string with image data." | |||
| 631 | (nbody (if body (shr-max-columns body))) | 631 | (nbody (if body (shr-max-columns body))) |
| 632 | (nfooter (if footer (shr-max-columns footer)))) | 632 | (nfooter (if footer (shr-max-columns footer)))) |
| 633 | (shr-tag-table-1 | 633 | (shr-tag-table-1 |
| 634 | (nconc | 634 | (if caption |
| 635 | (if caption | 635 | (if header |
| 636 | (if header | 636 | (if footer |
| 637 | (if footer | 637 | ;; caption + hader + body + footer |
| 638 | ;; caption + hader + body + footer | 638 | (if (= nheader nbody) |
| 639 | (if (= nheader nbody) | 639 | (if (= nbody nfooter) |
| 640 | (if (= nbody nfooter) | 640 | `((tr (td ,@caption)) |
| 641 | `((tr (td ,@caption)) | 641 | (tr (td (table (tbody ,@header ,@body ,@footer))))) |
| 642 | (tr (td (table (tbody ,@header ,@body ,@footer))))) | 642 | (if (= nfooter 1) |
| 643 | (if (= nfooter 1) | 643 | `((tr (td ,@caption)) |
| 644 | `((tr (td ,@caption)) | 644 | (tr (td (table (tbody ,@header ,@body)))) |
| 645 | (tr (td (table (tbody ,@header ,@body)))) | 645 | ,@footer) |
| 646 | ,@footer) | 646 | `((tr (td ,@caption)) |
| 647 | `((tr (td ,@caption)) | 647 | (tr (td (table (tbody ,@header ,@body)))) |
| 648 | (tr (td (table (tbody ,@header ,@body)))) | 648 | (tr (td (table (tbody ,@footer))))))) |
| 649 | (tr (td (table (tbody ,@footer))))))) | 649 | (if (= nbody nfooter) |
| 650 | (if (= nbody nfooter) | 650 | `((tr (td ,@caption)) |
| 651 | `((tr (td ,@caption)) | 651 | (tr (td (table (tbody ,@header)))) |
| 652 | (tr (td (table (tbody ,@header)))) | 652 | (tr (td (table (tbody ,@body ,@footer))))) |
| 653 | (tr (td (table (tbody ,@body ,@footer))))) | 653 | (if (= nfooter 1) |
| 654 | (if (= nfooter 1) | 654 | `((tr (td ,@caption)) |
| 655 | `((tr (td ,@caption)) | 655 | (tr (td (table (tbody ,@header)))) |
| 656 | (tr (td (table (tbody ,@header)))) | 656 | (tr (td (table (tbody ,@body)))) |
| 657 | (tr (td (table (tbody ,@body)))) | 657 | ,@footer) |
| 658 | ,@footer) | 658 | `((tr (td ,@caption)) |
| 659 | `((tr (td ,@caption)) | 659 | (tr (td (table (tbody ,@header)))) |
| 660 | (tr (td (table (tbody ,@header)))) | 660 | (tr (td (table (tbody ,@body)))) |
| 661 | (tr (td (table (tbody ,@body)))) | 661 | (tr (td (table (tbody ,@footer)))))))) |
| 662 | (tr (td (table (tbody ,@footer)))))))) | 662 | ;; caption + header + body |
| 663 | ;; caption + header + body | 663 | (if (= nheader nbody) |
| 664 | (if (= nheader nbody) | 664 | `((tr (td ,@caption)) |
| 665 | `((tr (td ,@caption)) | 665 | (tr (td (table (tbody ,@header ,@body))))) |
| 666 | (tr (td (table (tbody ,@header ,@body))))) | 666 | (if (= nheader 1) |
| 667 | (if (= nheader 1) | 667 | `((tr (td ,@caption)) |
| 668 | `((tr (td ,@caption)) | 668 | ,@header (tr (td (table (tbody ,@body))))) |
| 669 | ,@header (tr (td (table (tbody ,@body))))) | 669 | `((tr (td ,@caption)) |
| 670 | `((tr (td ,@caption)) | 670 | (tr (td (table (tbody ,@header)))) |
| 671 | (tr (td (table (tbody ,@header)))) | 671 | (tr (td (table (tbody ,@body)))))))) |
| 672 | (tr (td (table (tbody ,@body)))))))) | 672 | (if footer |
| 673 | (if footer | 673 | ;; caption + body + footer |
| 674 | ;; caption + body + footer | 674 | (if (= nbody nfooter) |
| 675 | (if (= nbody nfooter) | 675 | `((tr (td (table (tbody ,@body ,@footer))))) |
| 676 | `((tr (td (table (tbody ,@body ,@footer))))) | 676 | (if (= nfooter 1) |
| 677 | (if (= nfooter 1) | 677 | `((tr (td (table (tbody ,@body)))) ,@footer) |
| 678 | `((tr (td (table (tbody ,@body)))) ,@footer) | 678 | `((tr (td (table (tbody ,@body)))) |
| 679 | `((tr (td (table (tbody ,@body)))) | 679 | (tr (td (table (tbody ,@footer))))))) |
| 680 | (tr (td (table (tbody ,@footer))))))) | 680 | ;; caption + body |
| 681 | ;; caption + body | 681 | `((tr (td ,@caption)) |
| 682 | `((tr (td ,@caption)) | 682 | (tr (td (table (tbody ,@body))))))) |
| 683 | (tr (td (table (tbody ,@body))))))) | 683 | (if header |
| 684 | (if header | 684 | (if footer |
| 685 | (if footer | 685 | ;; header + body + footer |
| 686 | ;; header + body + footer | 686 | (if (= nheader nbody) |
| 687 | (if (= nheader nbody) | 687 | (if (= nbody nfooter) |
| 688 | (if (= nbody nfooter) | 688 | `((tr (td (table (tbody ,@header ,@body ,@footer))))) |
| 689 | `((tr (td (table (tbody ,@header ,@body ,@footer))))) | 689 | (if (= nfooter 1) |
| 690 | (if (= nfooter 1) | 690 | `((tr (td (table (tbody ,@header ,@body)))) |
| 691 | `((tr (td (table (tbody ,@header ,@body)))) | 691 | ,@footer) |
| 692 | ,@footer) | 692 | `((tr (td (table (tbody ,@header ,@body)))) |
| 693 | `((tr (td (table (tbody ,@header ,@body)))) | 693 | (tr (td (table (tbody ,@footer))))))) |
| 694 | (tr (td (table (tbody ,@footer))))))) | 694 | (if (= nbody nfooter) |
| 695 | (if (= nbody nfooter) | 695 | `((tr (td (table (tbody ,@header)))) |
| 696 | `((tr (td (table (tbody ,@header)))) | 696 | (tr (td (table (tbody ,@body ,@footer))))) |
| 697 | (tr (td (table (tbody ,@body ,@footer))))) | 697 | (if (= nfooter 1) |
| 698 | (if (= nfooter 1) | 698 | `((tr (td (table (tbody ,@header)))) |
| 699 | `((tr (td (table (tbody ,@header)))) | 699 | (tr (td (table (tbody ,@body)))) |
| 700 | (tr (td (table (tbody ,@body)))) | 700 | ,@footer) |
| 701 | ,@footer) | 701 | `((tr (td (table (tbody ,@header)))) |
| 702 | `((tr (td (table (tbody ,@header)))) | 702 | (tr (td (table (tbody ,@body)))) |
| 703 | (tr (td (table (tbody ,@body)))) | 703 | (tr (td (table (tbody ,@footer)))))))) |
| 704 | (tr (td (table (tbody ,@footer)))))))) | 704 | ;; header + body |
| 705 | ;; header + body | 705 | (if (= nheader nbody) |
| 706 | (if (= nheader nbody) | 706 | `((tr (td (table (tbody ,@header ,@body))))) |
| 707 | `((tr (td (table (tbody ,@header ,@body))))) | 707 | (if (= nheader 1) |
| 708 | (if (= nheader 1) | 708 | `(,@header (tr (td (table (tbody ,@body))))) |
| 709 | `(,@header (tr (td (table (tbody ,@body))))) | 709 | `((tr (td (table (tbody ,@header)))) |
| 710 | `((tr (td (table (tbody ,@header)))) | 710 | (tr (td (table (tbody ,@body)))))))) |
| 711 | (tr (td (table (tbody ,@body)))))))) | 711 | (if footer |
| 712 | (if footer | 712 | ;; body + footer |
| 713 | ;; body + footer | 713 | (if (= nbody nfooter) |
| 714 | (if (= nbody nfooter) | 714 | `((tr (td (table (tbody ,@body ,@footer))))) |
| 715 | `((tr (td (table (tbody ,@body ,@footer))))) | 715 | (if (= nfooter 1) |
| 716 | (if (= nfooter 1) | 716 | `((tr (td (table (tbody ,@body)))) ,@footer) |
| 717 | `((tr (td (table (tbody ,@body)))) ,@footer) | 717 | `((tr (td (table (tbody ,@body)))) |
| 718 | `((tr (td (table (tbody ,@body)))) | 718 | (tr (td (table (tbody ,@footer))))))) |
| 719 | (tr (td (table (tbody ,@footer))))))) | 719 | body)))))) |
| 720 | body))))))) | ||
| 721 | 720 | ||
| 722 | (defun shr-find-elements (cont type) | 721 | (defun shr-find-elements (cont type) |
| 723 | (let (result) | 722 | (let (result) |
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index 448a0088fb8..097299f30c4 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el | |||
| @@ -1287,6 +1287,7 @@ variable. When the processor variable is nil, just the | |||
| 1287 | classification and spam-use-* check variable are used. This is | 1287 | classification and spam-use-* check variable are used. This is |
| 1288 | superseded by the new spam backend code, so it's only consulted | 1288 | superseded by the new spam backend code, so it's only consulted |
| 1289 | for backwards compatibility.") | 1289 | for backwards compatibility.") |
| 1290 | (make-obsolete-variable 'spam-list-of-processors nil "22.1") | ||
| 1290 | 1291 | ||
| 1291 | (defun spam-group-processor-p (group backend &optional classification) | 1292 | (defun spam-group-processor-p (group backend &optional classification) |
| 1292 | "Checks if GROUP has a BACKEND with CLASSIFICATION registered. | 1293 | "Checks if GROUP has a BACKEND with CLASSIFICATION registered. |