comparison lisp/gnus/gnus-art.el @ 49598:0d8b17d428b5

Trailing whitepace deleted.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 04 Feb 2003 13:24:35 +0000
parents 52d99cc2e9e3
children 629f8ae0c58f d7ddb3e565de
comparison
equal deleted inserted replaced
49597:e88404e8f2cf 49598:0d8b17d428b5
228 :type '(choice regexp (const nil)) 228 :type '(choice regexp (const nil))
229 :group 'gnus-article-washing) 229 :group 'gnus-article-washing)
230 230
231 (defcustom gnus-article-banner-alist nil 231 (defcustom gnus-article-banner-alist nil
232 "Banner alist for stripping. 232 "Banner alist for stripping.
233 For example, 233 For example,
234 ((egroups . \"^[ \\t\\n]*-------------------+\\\\( eGroups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))" 234 ((egroups . \"^[ \\t\\n]*-------------------+\\\\( eGroups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))"
235 :version "21.1" 235 :version "21.1"
236 :type '(repeat (cons symbol regexp)) 236 :type '(repeat (cons symbol regexp))
237 :group 'gnus-article-washing) 237 :group 'gnus-article-washing)
238 238
656 :type 'boolean) 656 :type 'boolean)
657 657
658 (defcustom gnus-article-mime-match-handle-function 'undisplayed-alternative 658 (defcustom gnus-article-mime-match-handle-function 'undisplayed-alternative
659 "Function called with a MIME handle as the argument. 659 "Function called with a MIME handle as the argument.
660 This is meant for people who want to view first matched part. 660 This is meant for people who want to view first matched part.
661 For `undisplayed-alternative' (default), the first undisplayed 661 For `undisplayed-alternative' (default), the first undisplayed
662 part or alternative part is used. For `undisplayed', the first 662 part or alternative part is used. For `undisplayed', the first
663 undisplayed part is used. For a function, the first part which 663 undisplayed part is used. For a function, the first part which
664 the function return `t' is used. For `nil', the first part is 664 the function return `t' is used. For `nil', the first part is
665 used." 665 used."
666 :version "21.1" 666 :version "21.1"
667 :group 'gnus-article-mime 667 :group 'gnus-article-mime
668 :type '(choice 668 :type '(choice
669 (item :tag "first" :value nil) 669 (item :tag "first" :value nil)
670 (item :tag "undisplayed" :value undisplayed) 670 (item :tag "undisplayed" :value undisplayed)
671 (item :tag "undisplayed or alternative" 671 (item :tag "undisplayed or alternative"
672 :value undisplayed-alternative) 672 :value undisplayed-alternative)
673 (function))) 673 (function)))
674 674
675 (defcustom gnus-mime-action-alist 675 (defcustom gnus-mime-action-alist
676 '(("save to file" . gnus-mime-save-part) 676 '(("save to file" . gnus-mime-save-part)
735 See the manual for details." 735 See the manual for details."
736 :group 'gnus-article-treat 736 :group 'gnus-article-treat
737 :type gnus-article-treat-head-custom) 737 :type gnus-article-treat-head-custom)
738 (put 'gnus-treat-buttonize-head 'highlight t) 738 (put 'gnus-treat-buttonize-head 'highlight t)
739 739
740 (defcustom gnus-treat-emphasize 740 (defcustom gnus-treat-emphasize
741 (and (or window-system 741 (and (or window-system
742 (featurep 'xemacs) 742 (featurep 'xemacs)
743 (>= (string-to-number emacs-version) 21)) 743 (>= (string-to-number emacs-version) 21))
744 50000) 744 50000)
745 "Emphasize text. 745 "Emphasize text.
923 See the manual for details." 923 See the manual for details."
924 :group 'gnus-article-treat 924 :group 'gnus-article-treat
925 :type gnus-article-treat-custom) 925 :type gnus-article-treat-custom)
926 (put 'gnus-treat-overstrike 'highlight t) 926 (put 'gnus-treat-overstrike 'highlight t)
927 927
928 (defcustom gnus-treat-display-xface 928 (defcustom gnus-treat-display-xface
929 (and (or (and (fboundp 'image-type-available-p) 929 (and (or (and (fboundp 'image-type-available-p)
930 (image-type-available-p 'xbm) 930 (image-type-available-p 'xbm)
931 (string-match "^0x" (shell-command-to-string "uncompface"))) 931 (string-match "^0x" (shell-command-to-string "uncompface")))
932 (and (featurep 'xemacs) (featurep 'xface))) 932 (and (featurep 'xemacs) (featurep 'xface)))
933 'head) 933 'head)
937 :group 'gnus-article-treat 937 :group 'gnus-article-treat
938 :version "21.1" 938 :version "21.1"
939 :type gnus-article-treat-head-custom) 939 :type gnus-article-treat-head-custom)
940 (put 'gnus-treat-display-xface 'highlight t) 940 (put 'gnus-treat-display-xface 'highlight t)
941 941
942 (defcustom gnus-treat-display-smileys 942 (defcustom gnus-treat-display-smileys
943 (if (or (and (featurep 'xemacs) 943 (if (or (and (featurep 'xemacs)
944 (featurep 'xpm)) 944 (featurep 'xpm))
945 (and (fboundp 'image-type-available-p) 945 (and (fboundp 'image-type-available-p)
946 (image-type-available-p 'pbm))) 946 (image-type-available-p 'pbm)))
947 t nil) 947 t nil)
1510 (save-excursion 1510 (save-excursion
1511 (set-buffer gnus-article-buffer) 1511 (set-buffer gnus-article-buffer)
1512 (let ((inhibit-point-motion-hooks t) 1512 (let ((inhibit-point-motion-hooks t)
1513 buffer-read-only 1513 buffer-read-only
1514 (mail-parse-charset gnus-newsgroup-charset) 1514 (mail-parse-charset gnus-newsgroup-charset)
1515 (mail-parse-ignored-charsets 1515 (mail-parse-ignored-charsets
1516 (save-excursion (set-buffer gnus-summary-buffer) 1516 (save-excursion (set-buffer gnus-summary-buffer)
1517 gnus-newsgroup-ignored-charsets))) 1517 gnus-newsgroup-ignored-charsets)))
1518 (mail-decode-encoded-word-region (point-min) (point-max))))) 1518 (mail-decode-encoded-word-region (point-min) (point-max)))))
1519 1519
1520 (defun article-decode-charset (&optional prompt) 1520 (defun article-decode-charset (&optional prompt)
1522 If PROMPT (the prefix), prompt for a coding system to use." 1522 If PROMPT (the prefix), prompt for a coding system to use."
1523 (interactive "P") 1523 (interactive "P")
1524 (let ((inhibit-point-motion-hooks t) (case-fold-search t) 1524 (let ((inhibit-point-motion-hooks t) (case-fold-search t)
1525 buffer-read-only 1525 buffer-read-only
1526 (mail-parse-charset gnus-newsgroup-charset) 1526 (mail-parse-charset gnus-newsgroup-charset)
1527 (mail-parse-ignored-charsets 1527 (mail-parse-ignored-charsets
1528 (save-excursion (condition-case nil 1528 (save-excursion (condition-case nil
1529 (set-buffer gnus-summary-buffer) 1529 (set-buffer gnus-summary-buffer)
1530 (error)) 1530 (error))
1531 gnus-newsgroup-ignored-charsets)) 1531 gnus-newsgroup-ignored-charsets))
1532 ct cte ctl charset format) 1532 ct cte ctl charset format)
1543 (ctl 1543 (ctl
1544 (mail-content-type-get ctl 'charset))) 1544 (mail-content-type-get ctl 'charset)))
1545 format (and ctl (mail-content-type-get ctl 'format))) 1545 format (and ctl (mail-content-type-get ctl 'format)))
1546 (when cte 1546 (when cte
1547 (setq cte (mail-header-strip cte))) 1547 (setq cte (mail-header-strip cte)))
1548 (if (and ctl (not (string-match "/" (car ctl)))) 1548 (if (and ctl (not (string-match "/" (car ctl))))
1549 (setq ctl nil)) 1549 (setq ctl nil))
1550 (goto-char (point-max))) 1550 (goto-char (point-max)))
1551 (forward-line 1) 1551 (forward-line 1)
1552 (save-restriction 1552 (save-restriction
1553 (narrow-to-region (point) (point-max)) 1553 (narrow-to-region (point) (point-max))
1565 1565
1566 (defun article-decode-encoded-words () 1566 (defun article-decode-encoded-words ()
1567 "Remove encoded-word encoding from headers." 1567 "Remove encoded-word encoding from headers."
1568 (let ((inhibit-point-motion-hooks t) 1568 (let ((inhibit-point-motion-hooks t)
1569 (mail-parse-charset gnus-newsgroup-charset) 1569 (mail-parse-charset gnus-newsgroup-charset)
1570 (mail-parse-ignored-charsets 1570 (mail-parse-ignored-charsets
1571 (save-excursion (condition-case nil 1571 (save-excursion (condition-case nil
1572 (set-buffer gnus-summary-buffer) 1572 (set-buffer gnus-summary-buffer)
1573 (error)) 1573 (error))
1574 gnus-newsgroup-ignored-charsets)) 1574 gnus-newsgroup-ignored-charsets))
1575 buffer-read-only) 1575 buffer-read-only)
1587 (if (gnus-buffer-live-p gnus-original-article-buffer) 1587 (if (gnus-buffer-live-p gnus-original-article-buffer)
1588 (with-current-buffer gnus-original-article-buffer 1588 (with-current-buffer gnus-original-article-buffer
1589 (setq type 1589 (setq type
1590 (gnus-fetch-field "content-transfer-encoding")) 1590 (gnus-fetch-field "content-transfer-encoding"))
1591 (let* ((ct (gnus-fetch-field "content-type")) 1591 (let* ((ct (gnus-fetch-field "content-type"))
1592 (ctl (and ct 1592 (ctl (and ct
1593 (ignore-errors 1593 (ignore-errors
1594 (mail-header-parse-content-type ct))))) 1594 (mail-header-parse-content-type ct)))))
1595 (setq charset (and ctl 1595 (setq charset (and ctl
1596 (mail-content-type-get ctl 'charset))) 1596 (mail-content-type-get ctl 'charset)))
1597 (if (stringp charset) 1597 (if (stringp charset)
1598 (setq charset (intern (downcase charset))))))) 1598 (setq charset (intern (downcase charset)))))))
1599 (unless charset 1599 (unless charset
1600 (setq charset gnus-newsgroup-charset)) 1600 (setq charset gnus-newsgroup-charset))
1601 (when (or force 1601 (when (or force
1602 (and type (let ((case-fold-search t)) 1602 (and type (let ((case-fold-search t))
1603 (string-match "quoted-printable" type)))) 1603 (string-match "quoted-printable" type))))
1604 (article-goto-body) 1604 (article-goto-body)
1614 (if (gnus-buffer-live-p gnus-original-article-buffer) 1614 (if (gnus-buffer-live-p gnus-original-article-buffer)
1615 (with-current-buffer gnus-original-article-buffer 1615 (with-current-buffer gnus-original-article-buffer
1616 (setq type 1616 (setq type
1617 (gnus-fetch-field "content-transfer-encoding")) 1617 (gnus-fetch-field "content-transfer-encoding"))
1618 (let* ((ct (gnus-fetch-field "content-type")) 1618 (let* ((ct (gnus-fetch-field "content-type"))
1619 (ctl (and ct 1619 (ctl (and ct
1620 (ignore-errors 1620 (ignore-errors
1621 (mail-header-parse-content-type ct))))) 1621 (mail-header-parse-content-type ct)))))
1622 (setq charset (and ctl 1622 (setq charset (and ctl
1623 (mail-content-type-get ctl 'charset))) 1623 (mail-content-type-get ctl 'charset)))
1624 (if (stringp charset) 1624 (if (stringp charset)
1625 (setq charset (intern (downcase charset))))))) 1625 (setq charset (intern (downcase charset)))))))
1626 (unless charset 1626 (unless charset
1627 (setq charset gnus-newsgroup-charset)) 1627 (setq charset gnus-newsgroup-charset))
1628 (when (or force 1628 (when (or force
1629 (and type (let ((case-fold-search t)) 1629 (and type (let ((case-fold-search t))
1630 (string-match "base64" type)))) 1630 (string-match "base64" type))))
1631 (article-goto-body) 1631 (article-goto-body)
1653 (let ((buffer-read-only nil) 1653 (let ((buffer-read-only nil)
1654 charset) 1654 charset)
1655 (if (gnus-buffer-live-p gnus-original-article-buffer) 1655 (if (gnus-buffer-live-p gnus-original-article-buffer)
1656 (with-current-buffer gnus-original-article-buffer 1656 (with-current-buffer gnus-original-article-buffer
1657 (let* ((ct (gnus-fetch-field "content-type")) 1657 (let* ((ct (gnus-fetch-field "content-type"))
1658 (ctl (and ct 1658 (ctl (and ct
1659 (ignore-errors 1659 (ignore-errors
1660 (mail-header-parse-content-type ct))))) 1660 (mail-header-parse-content-type ct)))))
1661 (setq charset (and ctl 1661 (setq charset (and ctl
1662 (mail-content-type-get ctl 'charset))) 1662 (mail-content-type-get ctl 'charset)))
1663 (if (stringp charset) 1663 (if (stringp charset)
1664 (setq charset (intern (downcase charset))))))) 1664 (setq charset (intern (downcase charset)))))))
1665 (unless charset 1665 (unless charset
1666 (setq charset gnus-newsgroup-charset)) 1666 (setq charset gnus-newsgroup-charset))
1667 (article-goto-body) 1667 (article-goto-body)
1668 (save-window-excursion 1668 (save-window-excursion
1669 (save-restriction 1669 (save-restriction
1670 (narrow-to-region (point) (point-max)) 1670 (narrow-to-region (point) (point-max))
1688 (let ((regexp (if (stringp gnus-list-identifiers) gnus-list-identifiers 1688 (let ((regexp (if (stringp gnus-list-identifiers) gnus-list-identifiers
1689 (mapconcat 'identity gnus-list-identifiers " *\\|")))) 1689 (mapconcat 'identity gnus-list-identifiers " *\\|"))))
1690 (when regexp 1690 (when regexp
1691 (goto-char (point-min)) 1691 (goto-char (point-min))
1692 (when (re-search-forward 1692 (when (re-search-forward
1693 (concat "^Subject: +\\(\\(\\(Re: +\\)?\\(" regexp 1693 (concat "^Subject: +\\(\\(\\(Re: +\\)?\\(" regexp
1694 " *\\)\\)+\\(Re: +\\)?\\)") 1694 " *\\)\\)+\\(Re: +\\)?\\)")
1695 nil t) 1695 nil t)
1696 (let ((s (or (match-string 3) (match-string 5)))) 1696 (let ((s (or (match-string 3) (match-string 5))))
1697 (delete-region (match-beginning 1) (match-end 1)) 1697 (delete-region (match-beginning 1) (match-end 1))
1698 (when s 1698 (when s
2001 (defun gnus-article-show-hidden-text (type &optional dummy) 2001 (defun gnus-article-show-hidden-text (type &optional dummy)
2002 "Show all hidden text of type TYPE. 2002 "Show all hidden text of type TYPE.
2003 Originally it is hide instead of DUMMY." 2003 Originally it is hide instead of DUMMY."
2004 (let ((buffer-read-only nil) 2004 (let ((buffer-read-only nil)
2005 (inhibit-point-motion-hooks t)) 2005 (inhibit-point-motion-hooks t))
2006 (gnus-remove-text-properties-when 2006 (gnus-remove-text-properties-when
2007 'article-type type 2007 'article-type type
2008 (point-min) (point-max) 2008 (point-min) (point-max)
2009 (cons 'article-type (cons type 2009 (cons 'article-type (cons type
2010 gnus-hidden-properties))))) 2010 gnus-hidden-properties)))))
2011 2011
2012 (defconst article-time-units 2012 (defconst article-time-units
2013 `((year . ,(* 365.25 24 60 60)) 2013 `((year . ,(* 365.25 24 60 60))
2091 ;; functions since they aren't particularly resistant to 2091 ;; functions since they aren't particularly resistant to
2092 ;; buggy dates. 2092 ;; buggy dates.
2093 ((eq type 'local) 2093 ((eq type 'local)
2094 (let ((tz (car (current-time-zone time)))) 2094 (let ((tz (car (current-time-zone time))))
2095 (format "Date: %s %s%02d%02d" (current-time-string time) 2095 (format "Date: %s %s%02d%02d" (current-time-string time)
2096 (if (> tz 0) "+" "-") (/ (abs tz) 3600) 2096 (if (> tz 0) "+" "-") (/ (abs tz) 3600)
2097 (/ (% (abs tz) 3600) 60)))) 2097 (/ (% (abs tz) 3600) 60))))
2098 ;; Convert to Universal Time. 2098 ;; Convert to Universal Time.
2099 ((eq type 'ut) 2099 ((eq type 'ut)
2100 (concat "Date: " 2100 (concat "Date: "
2101 (current-time-string 2101 (current-time-string
2124 (let ((tz (car (current-time-zone time)))) 2124 (let ((tz (car (current-time-zone time))))
2125 (concat 2125 (concat
2126 "Date: " 2126 "Date: "
2127 (format-time-string "%Y%m%dT%H%M%S" time) 2127 (format-time-string "%Y%m%dT%H%M%S" time)
2128 (format "%s%02d%02d" 2128 (format "%s%02d%02d"
2129 (if (> tz 0) "+" "-") (/ (abs tz) 3600) 2129 (if (> tz 0) "+" "-") (/ (abs tz) 3600)
2130 (/ (% (abs tz) 3600) 60))))) 2130 (/ (% (abs tz) 3600) 60)))))
2131 ;; Do an X-Sent lapsed format. 2131 ;; Do an X-Sent lapsed format.
2132 ((eq type 'lapsed) 2132 ((eq type 'lapsed)
2133 ;; If the date is seriously mangled, the timezone functions are 2133 ;; If the date is seriously mangled, the timezone functions are
2134 ;; liable to bug out, so we ignore all errors. 2134 ;; liable to bug out, so we ignore all errors.
2244 (defun article-emphasize (&optional arg) 2244 (defun article-emphasize (&optional arg)
2245 "Emphasize text according to `gnus-emphasis-alist'." 2245 "Emphasize text according to `gnus-emphasis-alist'."
2246 (interactive (gnus-article-hidden-arg)) 2246 (interactive (gnus-article-hidden-arg))
2247 (unless (gnus-article-check-hidden-text 'emphasis arg) 2247 (unless (gnus-article-check-hidden-text 'emphasis arg)
2248 (save-excursion 2248 (save-excursion
2249 (let ((alist (or 2249 (let ((alist (or
2250 (condition-case nil 2250 (condition-case nil
2251 (with-current-buffer gnus-summary-buffer 2251 (with-current-buffer gnus-summary-buffer
2252 gnus-article-emphasis-alist) 2252 gnus-article-emphasis-alist)
2253 (error)) 2253 (error))
2254 gnus-emphasis-alist)) 2254 gnus-emphasis-alist))
2255 (buffer-read-only nil) 2255 (buffer-read-only nil)
2256 (props (append '(article-type emphasis) 2256 (props (append '(article-type emphasis)
2257 gnus-hidden-properties)) 2257 gnus-hidden-properties))
2279 "Setup newsgroup emphasis alist." 2279 "Setup newsgroup emphasis alist."
2280 (unless gnus-article-emphasis-alist 2280 (unless gnus-article-emphasis-alist
2281 (let ((name (and gnus-newsgroup-name 2281 (let ((name (and gnus-newsgroup-name
2282 (gnus-group-real-name gnus-newsgroup-name)))) 2282 (gnus-group-real-name gnus-newsgroup-name))))
2283 (make-local-variable 'gnus-article-emphasis-alist) 2283 (make-local-variable 'gnus-article-emphasis-alist)
2284 (setq gnus-article-emphasis-alist 2284 (setq gnus-article-emphasis-alist
2285 (nconc 2285 (nconc
2286 (let ((alist gnus-group-highlight-words-alist) elem highlight) 2286 (let ((alist gnus-group-highlight-words-alist) elem highlight)
2287 (while (setq elem (pop alist)) 2287 (while (setq elem (pop alist))
2288 (when (and name (string-match (car elem) name)) 2288 (when (and name (string-match (car elem) name))
2289 (setq alist nil 2289 (setq alist nil
2290 highlight (copy-sequence (cdr elem))))) 2290 highlight (copy-sequence (cdr elem)))))
2291 highlight) 2291 highlight)
2292 (copy-sequence highlight-words) 2292 (copy-sequence highlight-words)
2293 (if gnus-newsgroup-name 2293 (if gnus-newsgroup-name
2294 (copy-sequence (gnus-group-find-parameter 2294 (copy-sequence (gnus-group-find-parameter
2295 gnus-newsgroup-name 'highlight-words t))) 2295 gnus-newsgroup-name 'highlight-words t)))
2296 gnus-emphasis-alist))))) 2296 gnus-emphasis-alist)))))
2297 2297
2298 (eval-when-compile 2298 (eval-when-compile
2299 (defvar gnus-summary-article-menu) 2299 (defvar gnus-summary-article-menu)
2334 function group headers variable) 2334 function group headers variable)
2335 (let ((default-name 2335 (let ((default-name
2336 (funcall function group headers (symbol-value variable))) 2336 (funcall function group headers (symbol-value variable)))
2337 result) 2337 result)
2338 (setq result 2338 (setq result
2339 (expand-file-name 2339 (expand-file-name
2340 (cond 2340 (cond
2341 ((eq filename 'default) 2341 ((eq filename 'default)
2342 default-name) 2342 default-name)
2343 ((eq filename t) 2343 ((eq filename t)
2344 default-name) 2344 default-name)
2699 ["Decode HZ" gnus-article-decode-HZ t])) 2699 ["Decode HZ" gnus-article-decode-HZ t]))
2700 2700
2701 ;; Note "Commands" menu is defined in gnus-sum.el for consistency 2701 ;; Note "Commands" menu is defined in gnus-sum.el for consistency
2702 2702
2703 (when (boundp 'gnus-summary-post-menu) 2703 (when (boundp 'gnus-summary-post-menu)
2704 (cond 2704 (cond
2705 ((not (keymapp gnus-summary-post-menu)) 2705 ((not (keymapp gnus-summary-post-menu))
2706 (setq gnus-article-post-menu gnus-summary-post-menu)) 2706 (setq gnus-article-post-menu gnus-summary-post-menu))
2707 ((not gnus-article-post-menu) 2707 ((not gnus-article-post-menu)
2708 ;; Don't share post menu. 2708 ;; Don't share post menu.
2709 (setq gnus-article-post-menu 2709 (setq gnus-article-post-menu
2785 (set-buffer name) 2785 (set-buffer name)
2786 (when gnus-article-mime-handles 2786 (when gnus-article-mime-handles
2787 (mm-destroy-parts gnus-article-mime-handles) 2787 (mm-destroy-parts gnus-article-mime-handles)
2788 (setq gnus-article-mime-handles nil)) 2788 (setq gnus-article-mime-handles nil))
2789 ;; Set it to nil in article-buffer! 2789 ;; Set it to nil in article-buffer!
2790 (setq gnus-article-mime-handle-alist nil) 2790 (setq gnus-article-mime-handle-alist nil)
2791 (buffer-disable-undo) 2791 (buffer-disable-undo)
2792 (setq buffer-read-only t) 2792 (setq buffer-read-only t)
2793 (unless (eq major-mode 'gnus-article-mode) 2793 (unless (eq major-mode 'gnus-article-mode)
2794 (gnus-article-mode)) 2794 (gnus-article-mode))
2795 (current-buffer)) 2795 (current-buffer))
3009 (interactive) 3009 (interactive)
3010 (save-current-buffer 3010 (save-current-buffer
3011 (set-buffer gnus-article-buffer) 3011 (set-buffer gnus-article-buffer)
3012 (let ((handles (or handles gnus-article-mime-handles)) 3012 (let ((handles (or handles gnus-article-mime-handles))
3013 (mail-parse-charset gnus-newsgroup-charset) 3013 (mail-parse-charset gnus-newsgroup-charset)
3014 (mail-parse-ignored-charsets 3014 (mail-parse-ignored-charsets
3015 (save-excursion (set-buffer gnus-summary-buffer) 3015 (save-excursion (set-buffer gnus-summary-buffer)
3016 gnus-newsgroup-ignored-charsets))) 3016 gnus-newsgroup-ignored-charsets)))
3017 (if (stringp (car handles)) 3017 (if (stringp (car handles))
3018 (gnus-mime-view-all-parts (cdr handles)) 3018 (gnus-mime-view-all-parts (cdr handles))
3019 (mapcar 'mm-display-part handles))))) 3019 (mapcar 'mm-display-part handles)))))
3107 (setq charset (or (mail-content-type-get 3107 (setq charset (or (mail-content-type-get
3108 (mm-handle-type handle) 'charset) 3108 (mm-handle-type handle) 'charset)
3109 gnus-newsgroup-charset))) 3109 gnus-newsgroup-charset)))
3110 ((numberp arg) 3110 ((numberp arg)
3111 (setq charset 3111 (setq charset
3112 (or (cdr (assq arg 3112 (or (cdr (assq arg
3113 gnus-summary-show-article-charset-alist)) 3113 gnus-summary-show-article-charset-alist))
3114 (read-coding-system "Charset: "))))) 3114 (read-coding-system "Charset: ")))))
3115 (forward-line 2) 3115 (forward-line 2)
3116 (mm-insert-inline handle 3116 (mm-insert-inline handle
3117 (if (and charset 3117 (if (and charset
3118 (setq charset (mm-charset-to-coding-system 3118 (setq charset (mm-charset-to-coding-system
3119 charset)) 3119 charset))
3120 (not (eq charset 'ascii))) 3120 (not (eq charset 'ascii)))
3121 (mm-decode-coding-string contents charset) 3121 (mm-decode-coding-string contents charset)
3122 contents)) 3122 contents))
3123 (goto-char b)))) 3123 (goto-char b))))
3128 (gnus-article-check-buffer) 3128 (gnus-article-check-buffer)
3129 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) 3129 (let* ((handle (or handle (get-text-property (point) 'gnus-data)))
3130 (mm-user-display-methods nil) 3130 (mm-user-display-methods nil)
3131 (mm-inlined-types nil) 3131 (mm-inlined-types nil)
3132 (mail-parse-charset gnus-newsgroup-charset) 3132 (mail-parse-charset gnus-newsgroup-charset)
3133 (mail-parse-ignored-charsets 3133 (mail-parse-ignored-charsets
3134 (save-excursion (set-buffer gnus-summary-buffer) 3134 (save-excursion (set-buffer gnus-summary-buffer)
3135 gnus-newsgroup-ignored-charsets))) 3135 gnus-newsgroup-ignored-charsets)))
3136 (if (mm-handle-undisplayer handle) 3136 (if (mm-handle-undisplayer handle)
3137 (mm-remove-part handle) 3137 (mm-remove-part handle)
3138 (mm-display-part handle)))) 3138 (mm-display-part handle))))
3144 (gnus-article-check-buffer) 3144 (gnus-article-check-buffer)
3145 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) 3145 (let* ((handle (or handle (get-text-property (point) 'gnus-data)))
3146 (mm-inlined-types '(".*")) 3146 (mm-inlined-types '(".*"))
3147 (mm-inline-large-images t) 3147 (mm-inline-large-images t)
3148 (mail-parse-charset gnus-newsgroup-charset) 3148 (mail-parse-charset gnus-newsgroup-charset)
3149 (mail-parse-ignored-charsets 3149 (mail-parse-ignored-charsets
3150 (save-excursion (set-buffer gnus-summary-buffer) 3150 (save-excursion (set-buffer gnus-summary-buffer)
3151 gnus-newsgroup-ignored-charsets))) 3151 gnus-newsgroup-ignored-charsets)))
3152 (if (mm-handle-undisplayer handle) 3152 (if (mm-handle-undisplayer handle)
3153 (mm-remove-part handle) 3153 (mm-remove-part handle)
3154 (mm-display-part handle)))) 3154 (mm-display-part handle))))
3204 3204
3205 (defun gnus-article-mime-match-handle-first (condition) 3205 (defun gnus-article-mime-match-handle-first (condition)
3206 (if condition 3206 (if condition
3207 (let ((alist gnus-article-mime-handle-alist) ihandle n) 3207 (let ((alist gnus-article-mime-handle-alist) ihandle n)
3208 (while (setq ihandle (pop alist)) 3208 (while (setq ihandle (pop alist))
3209 (if (and (cond 3209 (if (and (cond
3210 ((functionp condition) 3210 ((functionp condition)
3211 (funcall condition (cdr ihandle))) 3211 (funcall condition (cdr ihandle)))
3212 ((eq condition 'undisplayed) 3212 ((eq condition 'undisplayed)
3213 (not (or (mm-handle-undisplayer (cdr ihandle)) 3213 (not (or (mm-handle-undisplayer (cdr ihandle))
3214 (equal (mm-handle-media-type (cdr ihandle)) 3214 (equal (mm-handle-media-type (cdr ihandle))
3215 "multipart/alternative")))) 3215 "multipart/alternative"))))
3216 ((eq condition 'undisplayed-alternative) 3216 ((eq condition 'undisplayed-alternative)
3217 (not (mm-handle-undisplayer (cdr ihandle)))) 3217 (not (mm-handle-undisplayer (cdr ihandle))))
3225 (defun gnus-article-view-part (&optional n) 3225 (defun gnus-article-view-part (&optional n)
3226 "View MIME part N, which is the numerical prefix." 3226 "View MIME part N, which is the numerical prefix."
3227 (interactive "P") 3227 (interactive "P")
3228 (save-current-buffer 3228 (save-current-buffer
3229 (set-buffer gnus-article-buffer) 3229 (set-buffer gnus-article-buffer)
3230 (or (numberp n) (setq n (gnus-article-mime-match-handle-first 3230 (or (numberp n) (setq n (gnus-article-mime-match-handle-first
3231 gnus-article-mime-match-handle-function))) 3231 gnus-article-mime-match-handle-function)))
3232 (when (> n (length gnus-article-mime-handle-alist)) 3232 (when (> n (length gnus-article-mime-handle-alist))
3233 (error "No such part")) 3233 (error "No such part"))
3234 (let ((handle (cdr (assq n gnus-article-mime-handle-alist)))) 3234 (let ((handle (cdr (assq n gnus-article-mime-handle-alist))))
3235 (when (gnus-article-goto-part n) 3235 (when (gnus-article-goto-part n)
3250 buffer-read-only) 3250 buffer-read-only)
3251 (forward-line 1) 3251 (forward-line 1)
3252 (prog1 3252 (prog1
3253 (let ((window (selected-window)) 3253 (let ((window (selected-window))
3254 (mail-parse-charset gnus-newsgroup-charset) 3254 (mail-parse-charset gnus-newsgroup-charset)
3255 (mail-parse-ignored-charsets 3255 (mail-parse-ignored-charsets
3256 (save-excursion (set-buffer gnus-summary-buffer) 3256 (save-excursion (set-buffer gnus-summary-buffer)
3257 gnus-newsgroup-ignored-charsets))) 3257 gnus-newsgroup-ignored-charsets)))
3258 (save-excursion 3258 (save-excursion
3259 (unwind-protect 3259 (unwind-protect
3260 (let ((win (get-buffer-window (current-buffer) t)) 3260 (let ((win (get-buffer-window (current-buffer) t))
3481 (display 3481 (display
3482 (when move 3482 (when move
3483 (forward-line -2) 3483 (forward-line -2)
3484 (setq beg (point))) 3484 (setq beg (point)))
3485 (let ((mail-parse-charset gnus-newsgroup-charset) 3485 (let ((mail-parse-charset gnus-newsgroup-charset)
3486 (mail-parse-ignored-charsets 3486 (mail-parse-ignored-charsets
3487 (save-excursion (condition-case () 3487 (save-excursion (condition-case ()
3488 (set-buffer gnus-summary-buffer) 3488 (set-buffer gnus-summary-buffer)
3489 (error)) 3489 (error))
3490 gnus-newsgroup-ignored-charsets))) 3490 gnus-newsgroup-ignored-charsets)))
3491 (mm-display-part handle t)) 3491 (mm-display-part handle t))
3500 ;; Do highlighting. 3500 ;; Do highlighting.
3501 (save-excursion 3501 (save-excursion
3502 (save-restriction 3502 (save-restriction
3503 (narrow-to-region beg (point)) 3503 (narrow-to-region beg (point))
3504 (gnus-treat-article 3504 (gnus-treat-article
3505 nil id 3505 nil id
3506 (gnus-article-mime-total-parts) 3506 (gnus-article-mime-total-parts)
3507 (mm-handle-media-type handle))))))))) 3507 (mm-handle-media-type handle)))))))))
3508 3508
3509 (defun gnus-unbuttonized-mime-type-p (type) 3509 (defun gnus-unbuttonized-mime-type-p (type)
3510 "Say whether TYPE is to be unbuttonized." 3510 "Say whether TYPE is to be unbuttonized."
3595 (insert "\n\n")) 3595 (insert "\n\n"))
3596 (when preferred 3596 (when preferred
3597 (if (stringp (car preferred)) 3597 (if (stringp (car preferred))
3598 (gnus-display-mime preferred) 3598 (gnus-display-mime preferred)
3599 (let ((mail-parse-charset gnus-newsgroup-charset) 3599 (let ((mail-parse-charset gnus-newsgroup-charset)
3600 (mail-parse-ignored-charsets 3600 (mail-parse-ignored-charsets
3601 (save-excursion (set-buffer gnus-summary-buffer) 3601 (save-excursion (set-buffer gnus-summary-buffer)
3602 gnus-newsgroup-ignored-charsets))) 3602 gnus-newsgroup-ignored-charsets)))
3603 (mm-display-part preferred) 3603 (mm-display-part preferred)
3604 ;; Do highlighting. 3604 ;; Do highlighting.
3605 (save-excursion 3605 (save-excursion
3833 (let (gnus-pick-mode) 3833 (let (gnus-pick-mode)
3834 (push (or key last-command-event) unread-command-events) 3834 (push (or key last-command-event) unread-command-events)
3835 (setq keys (if (featurep 'xemacs) 3835 (setq keys (if (featurep 'xemacs)
3836 (events-to-keys (read-key-sequence nil)) 3836 (events-to-keys (read-key-sequence nil))
3837 (read-key-sequence nil))))) 3837 (read-key-sequence nil)))))
3838 3838
3839 (message "") 3839 (message "")
3840 3840
3841 (if (or (member keys nosaves) 3841 (if (or (member keys nosaves)
3842 (member keys nosave-but-article) 3842 (member keys nosave-but-article)
3843 (member keys nosave-in-article)) 3843 (member keys nosave-in-article))
4039 'article) 4039 'article)
4040 ;; Get the article and put into the article buffer. 4040 ;; Get the article and put into the article buffer.
4041 ((or (stringp article) 4041 ((or (stringp article)
4042 (numberp article)) 4042 (numberp article))
4043 (let ((gnus-override-method gnus-override-method) 4043 (let ((gnus-override-method gnus-override-method)
4044 (methods (and (stringp article) 4044 (methods (and (stringp article)
4045 gnus-refer-article-method)) 4045 gnus-refer-article-method))
4046 result 4046 result
4047 (buffer-read-only nil)) 4047 (buffer-read-only nil))
4048 (if (or (not (listp methods)) 4048 (if (or (not (listp methods))
4049 (and (symbolp (car methods)) 4049 (and (symbolp (car methods))
4061 (gnus-kill-all-overlays) 4061 (gnus-kill-all-overlays)
4062 (let ((gnus-newsgroup-name group)) 4062 (let ((gnus-newsgroup-name group))
4063 (gnus-check-group-server)) 4063 (gnus-check-group-server))
4064 (when (gnus-request-article article group (current-buffer)) 4064 (when (gnus-request-article article group (current-buffer))
4065 (when (numberp article) 4065 (when (numberp article)
4066 (gnus-async-prefetch-next group article 4066 (gnus-async-prefetch-next group article
4067 gnus-summary-buffer) 4067 gnus-summary-buffer)
4068 (when gnus-keep-backlog 4068 (when gnus-keep-backlog
4069 (gnus-backlog-enter-article 4069 (gnus-backlog-enter-article
4070 group article (current-buffer)))) 4070 group article (current-buffer))))
4071 (setq result 'article)) 4071 (setq result 'article))
4264 4264
4265 ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>. 4265 ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>.
4266 4266
4267 ;;; Internal Variables: 4267 ;;; Internal Variables:
4268 4268
4269 (defcustom gnus-button-url-regexp 4269 (defcustom gnus-button-url-regexp
4270 (if (string-match "[[:digit:]]" "1") ;; support POSIX? 4270 (if (string-match "[[:digit:]]" "1") ;; support POSIX?
4271 "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=!?#$@~`%&*+|\\/:;.,[:word:]]+[-a-zA-Z0-9_=#$@~`%&*+|\\/[:word:]]\\)" 4271 "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=!?#$@~`%&*+|\\/:;.,[:word:]]+[-a-zA-Z0-9_=#$@~`%&*+|\\/[:word:]]\\)"
4272 "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?\\([-a-zA-Z0-9_=!?#$@~`%&*+|\\/:;.,]\\|\\w\\)+\\([-a-zA-Z0-9_=#$@~`%&*+|\\/]\\|\\w\\)\\)") 4272 "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?\\([-a-zA-Z0-9_=!?#$@~`%&*+|\\/:;.,]\\|\\w\\)+\\([-a-zA-Z0-9_=#$@~`%&*+|\\/]\\|\\w\\)\\)")
4273 "Regular expression that matches URLs." 4273 "Regular expression that matches URLs."
4274 :group 'gnus-article-buttons 4274 :group 'gnus-article-buttons