diff options
| author | Dave Love | 2000-10-27 23:14:59 +0000 |
|---|---|---|
| committer | Dave Love | 2000-10-27 23:14:59 +0000 |
| commit | e0bad764b152e294e1d535f132e9346d3477b274 (patch) | |
| tree | 5ca34547e7a510ceb27fdac2fe057f781cbb5005 | |
| parent | ae0b9b4690a0bcff233659d3892797b1743a99fd (diff) | |
| download | emacs-e0bad764b152e294e1d535f132e9346d3477b274.tar.gz emacs-e0bad764b152e294e1d535f132e9346d3477b274.zip | |
2000-10-27 John Wiegley <johnw@gnu.org>
* gnus-art.el (gnus-treat-hide-citation-maybe): Added this
variable to correspond with `gnus-article-hide-citation-maybe'.
(gnus-treatment-function-alist): Added entry for the above
correlation.
2000-10-27 Richard M. Alderson III <alderson@netcom2.netcom.com>
* gnus-art.el (gnus-read-save-file-name): expand-file-name.
2000-10-27 Kai Gro�ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
* gnus-art.el (article-strip-banner): Use
gnus-group-find-parameter rather than gnus-group-get-parameter, to
allow inheritance on the banner.
From elkin@tverd.astro.spbu.ru.
2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-art.el (gnus-request-article-this-buffer):
gnus-refer-article-method might be a single method.
(gnus-article-mime-total-parts): New function.
(gnus-mm-display-part): Use it.
(gnus-mime-display-single): Ditto.
(gnus-mime-display-alternative): Ditto.
(gnus-mime-inline-part): Check validity of charset.
(gnus-treat-display-smileys): Default value in Emacs 21.
* gnus-art.el: Define dynamic variables in eval-when-compile.
(gnus-article-prepare): Configure it again.
(gnus-insert-mime-button): Use gnus-overlay-buffer,
gnus-overlay-start.
(gnus-article-prepare): Configure windows before
gnus-article-prepare-display is called. Otherwise, BBDB's popup
window might be overrided.
(gnus-mime-inline-part): Use prefix argument only
when it is called interactively.
(gnus-mime-action-alist): New variable.
(gnus-mime-action-on-part): Use it.
(gnus-mime-button-commands): Add command ".".
(gnus-mime-inline-part): Support prefix argument.
(gnus-article-banner-alist): New variable.
(article-strip-banner): Use it.
| -rw-r--r-- | lisp/gnus/ChangeLog | 71 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 150 |
2 files changed, 184 insertions, 37 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5c232105809..28d5d5fc56c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2000-10-27 John Wiegley <johnw@gnu.org> | ||
| 2 | |||
| 3 | * gnus-art.el (gnus-treat-hide-citation-maybe): Added this | ||
| 4 | variable to correspond with `gnus-article-hide-citation-maybe'. | ||
| 5 | (gnus-treatment-function-alist): Added entry for the above | ||
| 6 | correlation. | ||
| 7 | |||
| 8 | 2000-10-27 Richard M. Alderson III <alderson@netcom2.netcom.com> | ||
| 9 | |||
| 10 | * gnus-art.el (gnus-read-save-file-name): expand-file-name. | ||
| 11 | |||
| 1 | 2000-10-27 Dave Love <fx@gnu.org> | 12 | 2000-10-27 Dave Love <fx@gnu.org> |
| 2 | 13 | ||
| 3 | * gnus.el: Don't require custom. Don't require message at top | 14 | * gnus.el: Don't require custom. Don't require message at top |
| @@ -6,11 +17,42 @@ | |||
| 6 | 17 | ||
| 7 | 2000-10-27 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | 18 | 2000-10-27 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> |
| 8 | 19 | ||
| 20 | * gnus-art.el (article-strip-banner): Use | ||
| 21 | gnus-group-find-parameter rather than gnus-group-get-parameter, to | ||
| 22 | allow inheritance on the banner. | ||
| 23 | From elkin@tverd.astro.spbu.ru. | ||
| 24 | |||
| 9 | * gnus-sum.el (gnus-get-split-value): Use first match only (Ed L | 25 | * gnus-sum.el (gnus-get-split-value): Use first match only (Ed L |
| 10 | Cashin <ecashin@coe.uga.edu>). | 26 | Cashin <ecashin@coe.uga.edu>). |
| 11 | 27 | ||
| 12 | 2000-10-27 Simon Josefsson <simon@josefsson.org> | 28 | 2000-10-27 Simon Josefsson <simon@josefsson.org> |
| 13 | 29 | ||
| 30 | * nnimap.el (nnimap-group-overview-filename): Create directory for | ||
| 31 | newfile (when use long filenames is nil). Copy+delete file if | ||
| 32 | rename didn't work. | ||
| 33 | (nnimap-group-overview-filename): `rename-file' and `copy-file' | ||
| 34 | doesn't return anything useful, use ignore-errors instead. | ||
| 35 | (nnimap-verify-uidvalidity): Delete overview file when | ||
| 36 | uid validity changes. | ||
| 37 | (nnimap-group-overview-filename): Store uidvalidity in filenames. | ||
| 38 | Rename old files into new format. | ||
| 39 | (nnimap-request-accept-article): Remove \n's from | ||
| 40 | From_ lines. | ||
| 41 | (nnimap-request-accept-article): Remove From[^:] lines. | ||
| 42 | (imap-starttls-p): Check for starttls binary. | ||
| 43 | (imap-starttls-open): More verbose. | ||
| 44 | (imap-gssapi-auth): Ditto. | ||
| 45 | (imap-kerberos4-auth): Ditto. | ||
| 46 | (imap-cram-md5-auth): Ditto. | ||
| 47 | (imap-login-auth): Ditto. | ||
| 48 | (imap-anonymous-auth): Ditto. | ||
| 49 | (imap-digest-md5-auth): Ditto. | ||
| 50 | (imap-open): Ditto. | ||
| 51 | (imap-digest-md5-p): Check capability first. | ||
| 52 | (imap-parse-flag-list): Correctly parse empty lists. | ||
| 53 | (imap-login-p): Support LOGINDISABLED. | ||
| 54 | (imap-parse-body): Work around bug in Sun SIMS. | ||
| 55 | |||
| 14 | * gnus-agent.el (gnus-agent-possibly-do-gcc): | 56 | * gnus-agent.el (gnus-agent-possibly-do-gcc): |
| 15 | (gnus-agent-restore-gcc): | 57 | (gnus-agent-restore-gcc): |
| 16 | (gnus-agent-possibly-save-gcc): New functions. | 58 | (gnus-agent-possibly-save-gcc): New functions. |
| @@ -34,6 +76,35 @@ | |||
| 34 | 76 | ||
| 35 | 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu> | 77 | 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu> |
| 36 | 78 | ||
| 79 | * gnus-art.el (gnus-request-article-this-buffer): | ||
| 80 | gnus-refer-article-method might be a single method. | ||
| 81 | (gnus-article-mime-total-parts): New function. | ||
| 82 | (gnus-mm-display-part): Use it. | ||
| 83 | (gnus-mime-display-single): Ditto. | ||
| 84 | (gnus-mime-display-alternative): Ditto. | ||
| 85 | (gnus-mime-inline-part): Check validity of charset. | ||
| 86 | (gnus-treat-display-smileys): Default value in Emacs 21. | ||
| 87 | * gnus-art.el: Define dynamic variables in eval-when-compile. | ||
| 88 | (gnus-article-prepare): Configure it again. | ||
| 89 | (gnus-insert-mime-button): Use gnus-overlay-buffer, | ||
| 90 | gnus-overlay-start. | ||
| 91 | (gnus-article-prepare): Configure windows before | ||
| 92 | gnus-article-prepare-display is called. Otherwise, BBDB's popup | ||
| 93 | window might be overrided. | ||
| 94 | (gnus-mime-inline-part): Use prefix argument only | ||
| 95 | when it is called interactively. | ||
| 96 | (gnus-mime-action-alist): New variable. | ||
| 97 | (gnus-mime-action-on-part): Use it. | ||
| 98 | (gnus-mime-button-commands): Add command ".". | ||
| 99 | (gnus-mime-inline-part): Support prefix argument. | ||
| 100 | (gnus-article-banner-alist): New variable. | ||
| 101 | (article-strip-banner): Use it. | ||
| 102 | |||
| 103 | * mailcap.el (mailcap-parse-mailcaps): Don't use parse-colon-path, | ||
| 104 | because they are files, not paths. | ||
| 105 | (mailcap-parse-mimetypes): Ditto. | ||
| 106 | (mailcap-mime-types): Use mailcap-mime-data. | ||
| 107 | |||
| 37 | * gnus.el (gnus-xmas-define): Defalias gnus-overlay-buffer, | 108 | * gnus.el (gnus-xmas-define): Defalias gnus-overlay-buffer, |
| 38 | gnus-overlay-start. | 109 | gnus-overlay-start. |
| 39 | * gnus.el (gnus-agent-fetching): New variable. | 110 | * gnus.el (gnus-agent-fetching): New variable. |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 55801cfcabb..0c327b8e79c 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. | 2 | ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> | 4 | ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 5 | ;; Maintainer: bugs@gnu.org | ||
| 5 | ;; Keywords: news | 6 | ;; Keywords: news |
| 6 | 7 | ||
| 7 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| @@ -205,7 +206,10 @@ regexp. If it matches, the text in question is not a signature." | |||
| 205 | (if (and (fboundp 'image-type-available-p) | 206 | (if (and (fboundp 'image-type-available-p) |
| 206 | (image-type-available-p 'xbm)) | 207 | (image-type-available-p 'xbm)) |
| 207 | 'gnus-article-display-xface | 208 | 'gnus-article-display-xface |
| 208 | "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | display -") | 209 | (if gnus-article-compface-xbm |
| 210 | "{ echo '/* Width=48, Height=48 */'; uncompface; } | display -" | ||
| 211 | "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \ | ||
| 212 | display -")) | ||
| 209 | "*String or function to be executed to display an X-Face header. | 213 | "*String or function to be executed to display an X-Face header. |
| 210 | If it is a string, the command will be executed in a sub-shell | 214 | If it is a string, the command will be executed in a sub-shell |
| 211 | asynchronously. The compressed face will be piped to this command." | 215 | asynchronously. The compressed face will be piped to this command." |
| @@ -219,6 +223,13 @@ asynchronously. The compressed face will be piped to this command." | |||
| 219 | :type '(choice regexp (const nil)) | 223 | :type '(choice regexp (const nil)) |
| 220 | :group 'gnus-article-washing) | 224 | :group 'gnus-article-washing) |
| 221 | 225 | ||
| 226 | (defcustom gnus-article-banner-alist nil | ||
| 227 | "Banner alist for stripping. | ||
| 228 | For example, | ||
| 229 | ((egroups . \"^[ \\t\\n]*-------------------+\\\\( eGroups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))" | ||
| 230 | :type '(repeat (cons symbol regexp)) | ||
| 231 | :group 'gnus-article-washing) | ||
| 232 | |||
| 222 | (defcustom gnus-emphasis-alist | 233 | (defcustom gnus-emphasis-alist |
| 223 | (let ((format | 234 | (let ((format |
| 224 | "\\(\\s-\\|^\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\s-\\|[-,;:\"]\\s-\\|[?!.]+\\s-\\|\\s)\\)") | 235 | "\\(\\s-\\|^\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\s-\\|[-,;:\"]\\s-\\|[?!.]+\\s-\\|\\s)\\)") |
| @@ -595,8 +606,8 @@ displayed by the first non-nil matching CONTENT face." | |||
| 595 | ("\223" "``") | 606 | ("\223" "``") |
| 596 | ("\224" "\"") | 607 | ("\224" "\"") |
| 597 | ("\225" "*") | 608 | ("\225" "*") |
| 598 | ("\226" "---") | 609 | ("\226" "-") |
| 599 | ("\227" "-") | 610 | ("\227" "--") |
| 600 | ("\231" "(TM)") | 611 | ("\231" "(TM)") |
| 601 | ("\233" ">") | 612 | ("\233" ">") |
| 602 | ("\234" "oe") | 613 | ("\234" "oe") |
| @@ -647,6 +658,20 @@ used." | |||
| 647 | :value undisplayed-alternative) | 658 | :value undisplayed-alternative) |
| 648 | (function))) | 659 | (function))) |
| 649 | 660 | ||
| 661 | (defcustom gnus-mime-action-alist | ||
| 662 | '(("save to file" . gnus-mime-save-part) | ||
| 663 | ("display as text" . gnus-mime-inline-part) | ||
| 664 | ("view the part" . gnus-mime-view-part) | ||
| 665 | ("pipe to command" . gnus-mime-pipe-part) | ||
| 666 | ("toggle display" . gnus-article-press-button) | ||
| 667 | ("view as type" . gnus-mime-view-part-as-type) | ||
| 668 | ("internalize type" . gnus-mime-internalize-part) | ||
| 669 | ("externalize type" . gnus-mime-externalize-part)) | ||
| 670 | "An alist of actions that run on the MIME attachment." | ||
| 671 | :group 'gnus-article-mime | ||
| 672 | :type '(repeat (cons (string :tag "name") | ||
| 673 | (function)))) | ||
| 674 | |||
| 650 | ;;; | 675 | ;;; |
| 651 | ;;; The treatment variables | 676 | ;;; The treatment variables |
| 652 | ;;; | 677 | ;;; |
| @@ -747,6 +772,13 @@ See the manual for details." | |||
| 747 | :group 'gnus-article-treat | 772 | :group 'gnus-article-treat |
| 748 | :type gnus-article-treat-custom) | 773 | :type gnus-article-treat-custom) |
| 749 | 774 | ||
| 775 | (defcustom gnus-treat-hide-citation-maybe nil | ||
| 776 | "Hide cited text. | ||
| 777 | Valid values are nil, t, `head', `last', an integer or a predicate. | ||
| 778 | See the manual for details." | ||
| 779 | :group 'gnus-article-treat | ||
| 780 | :type gnus-article-treat-custom) | ||
| 781 | |||
| 750 | (defcustom gnus-treat-strip-list-identifiers 'head | 782 | (defcustom gnus-treat-strip-list-identifiers 'head |
| 751 | "Strip list identifiers from `gnus-list-identifiers`. | 783 | "Strip list identifiers from `gnus-list-identifiers`. |
| 752 | Valid values are nil, t, `head', `last', an integer or a predicate. | 784 | Valid values are nil, t, `head', `last', an integer or a predicate. |
| @@ -873,7 +905,8 @@ See the manual for details." | |||
| 873 | 905 | ||
| 874 | (defcustom gnus-treat-display-xface | 906 | (defcustom gnus-treat-display-xface |
| 875 | (and (or (and (fboundp 'image-type-available-p) | 907 | (and (or (and (fboundp 'image-type-available-p) |
| 876 | (image-type-available-p 'xbm)) | 908 | (image-type-available-p 'xbm) |
| 909 | (string-match "^0x" (shell-command-to-string "uncompface"))) | ||
| 877 | (and (featurep 'xemacs) (featurep 'xface))) | 910 | (and (featurep 'xemacs) (featurep 'xface))) |
| 878 | 'head) | 911 | 'head) |
| 879 | "Display X-Face headers. | 912 | "Display X-Face headers. |
| @@ -883,9 +916,12 @@ See the manual for details." | |||
| 883 | :type gnus-article-treat-head-custom) | 916 | :type gnus-article-treat-head-custom) |
| 884 | (put 'gnus-treat-display-xface 'highlight t) | 917 | (put 'gnus-treat-display-xface 'highlight t) |
| 885 | 918 | ||
| 886 | (defcustom gnus-treat-display-smileys (if (and (featurep 'xemacs) | 919 | (defcustom gnus-treat-display-smileys |
| 887 | (featurep 'xpm)) | 920 | (if (or (and (featurep 'xemacs) |
| 888 | t nil) | 921 | (featurep 'xpm)) |
| 922 | (and (fboundp 'image-type-available-p) | ||
| 923 | (image-type-available-p 'pbm))) | ||
| 924 | t nil) | ||
| 889 | "Display smileys. | 925 | "Display smileys. |
| 890 | Valid values are nil, t, `head', `last', an integer or a predicate. | 926 | Valid values are nil, t, `head', `last', an integer or a predicate. |
| 891 | See the manual for details." | 927 | See the manual for details." |
| @@ -950,6 +986,7 @@ See the manual for details." | |||
| 950 | (gnus-treat-hide-boring-headers gnus-article-hide-boring-headers) | 986 | (gnus-treat-hide-boring-headers gnus-article-hide-boring-headers) |
| 951 | (gnus-treat-hide-signature gnus-article-hide-signature) | 987 | (gnus-treat-hide-signature gnus-article-hide-signature) |
| 952 | (gnus-treat-hide-citation gnus-article-hide-citation) | 988 | (gnus-treat-hide-citation gnus-article-hide-citation) |
| 989 | (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe) | ||
| 953 | (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) | 990 | (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) |
| 954 | (gnus-treat-strip-pgp gnus-article-hide-pgp) | 991 | (gnus-treat-strip-pgp gnus-article-hide-pgp) |
| 955 | (gnus-treat-strip-pem gnus-article-hide-pem) | 992 | (gnus-treat-strip-pem gnus-article-hide-pem) |
| @@ -1697,7 +1734,7 @@ always hide." | |||
| 1697 | (save-excursion | 1734 | (save-excursion |
| 1698 | (save-restriction | 1735 | (save-restriction |
| 1699 | (let ((inhibit-point-motion-hooks t) | 1736 | (let ((inhibit-point-motion-hooks t) |
| 1700 | (banner (gnus-group-get-parameter gnus-newsgroup-name 'banner)) | 1737 | (banner (gnus-group-find-parameter gnus-newsgroup-name 'banner)) |
| 1701 | (gnus-signature-limit nil) | 1738 | (gnus-signature-limit nil) |
| 1702 | buffer-read-only beg end) | 1739 | buffer-read-only beg end) |
| 1703 | (when banner | 1740 | (when banner |
| @@ -1708,6 +1745,10 @@ always hide." | |||
| 1708 | (widen) | 1745 | (widen) |
| 1709 | (forward-line -1) | 1746 | (forward-line -1) |
| 1710 | (delete-region (point) (point-max)))) | 1747 | (delete-region (point) (point-max)))) |
| 1748 | ((symbolp banner) | ||
| 1749 | (if (setq banner (cdr (assq banner gnus-article-banner-alist))) | ||
| 1750 | (while (re-search-forward banner nil t) | ||
| 1751 | (delete-region (match-beginning 0) (match-end 0))))) | ||
| 1711 | ((stringp banner) | 1752 | ((stringp banner) |
| 1712 | (while (re-search-forward banner nil t) | 1753 | (while (re-search-forward banner nil t) |
| 1713 | (delete-region (match-beginning 0) (match-end 0)))))))))) | 1754 | (delete-region (match-beginning 0) (match-end 0)))))))))) |
| @@ -2333,7 +2374,7 @@ This format is defined by the `gnus-article-time-format' variable." | |||
| 2333 | (setq file (expand-file-name (file-name-nondirectory default-name) | 2374 | (setq file (expand-file-name (file-name-nondirectory default-name) |
| 2334 | (file-name-as-directory file)))) | 2375 | (file-name-as-directory file)))) |
| 2335 | ;; Possibly translate some characters. | 2376 | ;; Possibly translate some characters. |
| 2336 | (nnheader-translate-file-chars file))))) | 2377 | (nnheader-translate-file-chars file)))))) |
| 2337 | (gnus-make-directory (file-name-directory result)) | 2378 | (gnus-make-directory (file-name-directory result)) |
| 2338 | (set variable result))) | 2379 | (set variable result))) |
| 2339 | 2380 | ||
| @@ -2816,6 +2857,8 @@ If ALL-HEADERS is non-nil, no headers are hidden." | |||
| 2816 | (gnus-set-global-variables) | 2857 | (gnus-set-global-variables) |
| 2817 | (setq gnus-have-all-headers | 2858 | (setq gnus-have-all-headers |
| 2818 | (or all-headers gnus-show-all-headers)))) | 2859 | (or all-headers gnus-show-all-headers)))) |
| 2860 | (save-excursion | ||
| 2861 | (gnus-configure-windows 'article)) | ||
| 2819 | (when (or (numberp article) | 2862 | (when (or (numberp article) |
| 2820 | (stringp article)) | 2863 | (stringp article)) |
| 2821 | (gnus-article-prepare-display) | 2864 | (gnus-article-prepare-display) |
| @@ -2881,7 +2924,8 @@ If ALL-HEADERS is non-nil, no headers are hidden." | |||
| 2881 | (gnus-mime-inline-part "i" "View As Text, In This Buffer") | 2924 | (gnus-mime-inline-part "i" "View As Text, In This Buffer") |
| 2882 | (gnus-mime-internalize-part "E" "View Internally") | 2925 | (gnus-mime-internalize-part "E" "View Internally") |
| 2883 | (gnus-mime-externalize-part "e" "View Externally") | 2926 | (gnus-mime-externalize-part "e" "View Externally") |
| 2884 | (gnus-mime-pipe-part "|" "Pipe To Command..."))) | 2927 | (gnus-mime-pipe-part "|" "Pipe To Command...") |
| 2928 | (gnus-mime-action-on-part "." "Take action on the part"))) | ||
| 2885 | 2929 | ||
| 2886 | (defun gnus-article-mime-part-status () | 2930 | (defun gnus-article-mime-part-status () |
| 2887 | (if gnus-article-mime-handle-alist-1 | 2931 | (if gnus-article-mime-handle-alist-1 |
| @@ -2999,19 +3043,35 @@ If ALL-HEADERS is non-nil, no headers are hidden." | |||
| 2999 | (setq buffer-file-name nil)) | 3043 | (setq buffer-file-name nil)) |
| 3000 | (goto-char (point-min)))) | 3044 | (goto-char (point-min)))) |
| 3001 | 3045 | ||
| 3002 | (defun gnus-mime-inline-part (&optional handle) | 3046 | (defun gnus-mime-inline-part (&optional handle arg) |
| 3003 | "Insert the MIME part under point into the current buffer." | 3047 | "Insert the MIME part under point into the current buffer." |
| 3004 | (interactive) | 3048 | (interactive (list nil current-prefix-arg)) |
| 3005 | (gnus-article-check-buffer) | 3049 | (gnus-article-check-buffer) |
| 3006 | (let* ((handle (or handle (get-text-property (point) 'gnus-data))) | 3050 | (let* ((handle (or handle (get-text-property (point) 'gnus-data))) |
| 3007 | contents | 3051 | contents charset |
| 3008 | (b (point)) | 3052 | (b (point)) |
| 3009 | buffer-read-only) | 3053 | buffer-read-only) |
| 3010 | (if (mm-handle-undisplayer handle) | 3054 | (if (mm-handle-undisplayer handle) |
| 3011 | (mm-remove-part handle) | 3055 | (mm-remove-part handle) |
| 3012 | (setq contents (mm-get-part handle)) | 3056 | (setq contents (mm-get-part handle)) |
| 3057 | (cond | ||
| 3058 | ((not arg) | ||
| 3059 | (setq charset (or (mail-content-type-get | ||
| 3060 | (mm-handle-type handle) 'charset) | ||
| 3061 | gnus-newsgroup-charset))) | ||
| 3062 | ((numberp arg) | ||
| 3063 | (setq charset | ||
| 3064 | (or (cdr (assq arg | ||
| 3065 | gnus-summary-show-article-charset-alist)) | ||
| 3066 | (read-coding-system "Charset: "))))) | ||
| 3013 | (forward-line 2) | 3067 | (forward-line 2) |
| 3014 | (mm-insert-inline handle contents) | 3068 | (mm-insert-inline handle |
| 3069 | (if (and charset | ||
| 3070 | (setq charset (mm-charset-to-coding-system | ||
| 3071 | charset)) | ||
| 3072 | (not (eq charset 'ascii))) | ||
| 3073 | (mm-decode-coding-string contents charset) | ||
| 3074 | contents)) | ||
| 3015 | (goto-char b)))) | 3075 | (goto-char b)))) |
| 3016 | 3076 | ||
| 3017 | (defun gnus-mime-externalize-part (&optional handle) | 3077 | (defun gnus-mime-externalize-part (&optional handle) |
| @@ -3045,6 +3105,16 @@ In no internal viewer is available, use an external viewer." | |||
| 3045 | (mm-remove-part handle) | 3105 | (mm-remove-part handle) |
| 3046 | (mm-display-part handle)))) | 3106 | (mm-display-part handle)))) |
| 3047 | 3107 | ||
| 3108 | (defun gnus-mime-action-on-part (&optional action) | ||
| 3109 | "Do something with the MIME attachment at \(point\)." | ||
| 3110 | (interactive | ||
| 3111 | (list (completing-read "Action: " gnus-mime-action-alist))) | ||
| 3112 | (gnus-article-check-buffer) | ||
| 3113 | (let ((action-pair (assoc action gnus-mime-action-alist))) | ||
| 3114 | (if action-pair | ||
| 3115 | (funcall (cdr action-pair))))) | ||
| 3116 | |||
| 3117 | |||
| 3048 | (defun gnus-article-part-wrapper (n function) | 3118 | (defun gnus-article-part-wrapper (n function) |
| 3049 | (save-current-buffer | 3119 | (save-current-buffer |
| 3050 | (set-buffer gnus-article-buffer) | 3120 | (set-buffer gnus-article-buffer) |
| @@ -3120,6 +3190,11 @@ In no internal viewer is available, use an external viewer." | |||
| 3120 | (when (eq (gnus-mm-display-part handle) 'internal) | 3190 | (when (eq (gnus-mm-display-part handle) 'internal) |
| 3121 | (gnus-set-window-start))))))) | 3191 | (gnus-set-window-start))))))) |
| 3122 | 3192 | ||
| 3193 | (defsubst gnus-article-mime-total-parts () | ||
| 3194 | (if (bufferp (car gnus-article-mime-handles)) | ||
| 3195 | 1 ;; single part | ||
| 3196 | (1- (length gnus-article-mime-handles)))) | ||
| 3197 | |||
| 3123 | (defun gnus-mm-display-part (handle) | 3198 | (defun gnus-mm-display-part (handle) |
| 3124 | "Display HANDLE and fix MIME button." | 3199 | "Display HANDLE and fix MIME button." |
| 3125 | (let ((id (get-text-property (point) 'gnus-part)) | 3200 | (let ((id (get-text-property (point) 'gnus-part)) |
| @@ -3153,7 +3228,7 @@ In no internal viewer is available, use an external viewer." | |||
| 3153 | (narrow-to-region (point) (point-max)) | 3228 | (narrow-to-region (point) (point-max)) |
| 3154 | (gnus-treat-article | 3229 | (gnus-treat-article |
| 3155 | nil id | 3230 | nil id |
| 3156 | (1- (length gnus-article-mime-handles)) | 3231 | (gnus-article-mime-total-parts) |
| 3157 | (mm-handle-media-type handle))))) | 3232 | (mm-handle-media-type handle))))) |
| 3158 | (select-window window)))) | 3233 | (select-window window)))) |
| 3159 | (goto-char point) | 3234 | (goto-char point) |
| @@ -3223,8 +3298,8 @@ In no internal viewer is available, use an external viewer." | |||
| 3223 | ;; window, overlay, position. | 3298 | ;; window, overlay, position. |
| 3224 | (if (mm-handle-displayed-p | 3299 | (if (mm-handle-displayed-p |
| 3225 | (if overlay | 3300 | (if overlay |
| 3226 | (with-current-buffer (overlay-buffer overlay) | 3301 | (with-current-buffer (gnus-overlay-buffer overlay) |
| 3227 | (widget-get (widget-at (overlay-start overlay)) | 3302 | (widget-get (widget-at (gnus-overlay-start overlay)) |
| 3228 | :mime-handle)) | 3303 | :mime-handle)) |
| 3229 | (widget-get widget/window :mime-handle))) | 3304 | (widget-get widget/window :mime-handle))) |
| 3230 | "hide" "show") | 3305 | "hide" "show") |
| @@ -3341,7 +3416,8 @@ In no internal viewer is available, use an external viewer." | |||
| 3341 | (setq display t) | 3416 | (setq display t) |
| 3342 | (when (equal (mm-handle-media-supertype handle) "text") | 3417 | (when (equal (mm-handle-media-supertype handle) "text") |
| 3343 | (setq text t))) | 3418 | (setq text t))) |
| 3344 | (let ((id (1+ (length gnus-article-mime-handle-alist)))) | 3419 | (let ((id (1+ (length gnus-article-mime-handle-alist))) |
| 3420 | beg) | ||
| 3345 | (push (cons id handle) gnus-article-mime-handle-alist) | 3421 | (push (cons id handle) gnus-article-mime-handle-alist) |
| 3346 | (when (or (not display) | 3422 | (when (or (not display) |
| 3347 | (not (gnus-unbuttonized-mime-type-p type))) | 3423 | (not (gnus-unbuttonized-mime-type-p type))) |
| @@ -3350,8 +3426,8 @@ In no internal viewer is available, use an external viewer." | |||
| 3350 | handle id (list (or display (and not-attachment text)))) | 3426 | handle id (list (or display (and not-attachment text)))) |
| 3351 | (gnus-article-insert-newline) | 3427 | (gnus-article-insert-newline) |
| 3352 | ;(gnus-article-insert-newline) | 3428 | ;(gnus-article-insert-newline) |
| 3353 | (setq move t))) | 3429 | (setq move t)) |
| 3354 | (let ((beg (point))) | 3430 | (setq beg (point)) |
| 3355 | (cond | 3431 | (cond |
| 3356 | (display | 3432 | (display |
| 3357 | (when move | 3433 | (when move |
| @@ -3377,8 +3453,8 @@ In no internal viewer is available, use an external viewer." | |||
| 3377 | (save-restriction | 3453 | (save-restriction |
| 3378 | (narrow-to-region beg (point)) | 3454 | (narrow-to-region beg (point)) |
| 3379 | (gnus-treat-article | 3455 | (gnus-treat-article |
| 3380 | nil (length gnus-article-mime-handle-alist) | 3456 | nil id |
| 3381 | (1- (length gnus-article-mime-handles)) | 3457 | (gnus-article-mime-total-parts) |
| 3382 | (mm-handle-media-type handle))))))))) | 3458 | (mm-handle-media-type handle))))))))) |
| 3383 | 3459 | ||
| 3384 | (defun gnus-unbuttonized-mime-type-p (type) | 3460 | (defun gnus-unbuttonized-mime-type-p (type) |
| @@ -3480,7 +3556,7 @@ In no internal viewer is available, use an external viewer." | |||
| 3480 | (narrow-to-region (car begend) (point-max)) | 3556 | (narrow-to-region (car begend) (point-max)) |
| 3481 | (gnus-treat-article | 3557 | (gnus-treat-article |
| 3482 | nil (length gnus-article-mime-handle-alist) | 3558 | nil (length gnus-article-mime-handle-alist) |
| 3483 | (1- (length gnus-article-mime-handles)) | 3559 | (gnus-article-mime-total-parts) |
| 3484 | (mm-handle-media-type handle)))))) | 3560 | (mm-handle-media-type handle)))))) |
| 3485 | (goto-char (point-max)) | 3561 | (goto-char (point-max)) |
| 3486 | (setcdr begend (point-marker))))) | 3562 | (setcdr begend (point-marker))))) |
| @@ -3885,10 +3961,10 @@ If given a prefix, show the hidden text instead." | |||
| 3885 | gnus-refer-article-method)) | 3961 | gnus-refer-article-method)) |
| 3886 | result | 3962 | result |
| 3887 | (buffer-read-only nil)) | 3963 | (buffer-read-only nil)) |
| 3888 | (setq methods | 3964 | (if (or (not (listp methods)) |
| 3889 | (if (listp methods) | 3965 | (and (symbolp (car methods)) |
| 3890 | methods | 3966 | (assq (car methods) nnoo-definition-alist))) |
| 3891 | (list methods))) | 3967 | (setq methods (list methods))) |
| 3892 | (when (and (null gnus-override-method) | 3968 | (when (and (null gnus-override-method) |
| 3893 | methods) | 3969 | methods) |
| 3894 | (setq gnus-override-method (pop methods))) | 3970 | (setq gnus-override-method (pop methods))) |
| @@ -4547,16 +4623,14 @@ forbidden in URL encoding." | |||
| 4547 | (message-goto-subject)))) | 4623 | (message-goto-subject)))) |
| 4548 | 4624 | ||
| 4549 | (defun gnus-button-mailto (address) | 4625 | (defun gnus-button-mailto (address) |
| 4550 | ;; Mail to ADDRESS. | 4626 | "Mail to ADDRESS." |
| 4551 | (set-buffer (gnus-copy-article-buffer)) | 4627 | (set-buffer (gnus-copy-article-buffer)) |
| 4552 | (message-reply address)) | 4628 | (message-reply address)) |
| 4553 | 4629 | ||
| 4554 | (defun gnus-button-reply (address) | 4630 | (defalias 'gnus-button-reply 'message-reply) |
| 4555 | ;; Reply to ADDRESS. | ||
| 4556 | (message-reply address)) | ||
| 4557 | 4631 | ||
| 4558 | (defun gnus-button-embedded-url (address) | 4632 | (defun gnus-button-embedded-url (address) |
| 4559 | "Browse ADDRESS." | 4633 | "Activate ADDRESS with `browse-url'." |
| 4560 | (browse-url (gnus-strip-whitespace address))) | 4634 | (browse-url (gnus-strip-whitespace address))) |
| 4561 | 4635 | ||
| 4562 | ;;; Next/prev buttons in the article buffer. | 4636 | ;;; Next/prev buttons in the article buffer. |
| @@ -4696,11 +4770,13 @@ For example: | |||
| 4696 | (funcall (cadr elem))))))) | 4770 | (funcall (cadr elem))))))) |
| 4697 | 4771 | ||
| 4698 | ;; Dynamic variables. | 4772 | ;; Dynamic variables. |
| 4699 | (defvar part-number) | 4773 | (eval-when-compile |
| 4700 | (defvar total-parts) | 4774 | (defvar part-number) |
| 4701 | (defvar type) | 4775 | (defvar total-parts) |
| 4702 | (defvar condition) | 4776 | (defvar type) |
| 4703 | (defvar length) | 4777 | (defvar condition) |
| 4778 | (defvar length)) | ||
| 4779 | |||
| 4704 | (defun gnus-treat-predicate (val) | 4780 | (defun gnus-treat-predicate (val) |
| 4705 | (cond | 4781 | (cond |
| 4706 | ((null val) | 4782 | ((null val) |