X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-sum.el;h=f001bcb83650fe57d0ca4ef449b8224c936d5467;hb=b5bf7441863224995c8cce628c46ad38b69f3ba5;hp=eb7e9df6b75b946971705e77e6f6a1c1580404c5;hpb=2fdafd7ab932ee8468943137195de4bae857bbb3;p=gnus diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index eb7e9df6b..f001bcb83 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -37,6 +37,7 @@ (require 'gnus-util) (require 'mm-decode) (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t) +(autoload 'gnus-cache-write-active "gnus-cache") (defcustom gnus-kill-summary-on-exit t "*If non-nil, kill the summary buffer when you exit from it. @@ -885,6 +886,14 @@ For example: ((1 . cn-gb-2312) (2 . big5))." :type '(choice (const nil) integer)) +(defcustom gnus-summary-save-parts-default-mime "image/.*" + "*A regexp to match MIME parts when saving multiple parts of a message +with gnus-summary-save-parts (X m). This regexp will be used by default +when prompting the user for which type of files to save." + :group 'gnus-summary + :type 'regexp) + + ;;; Internal variables (defvar gnus-article-mime-handles nil) @@ -902,6 +911,9 @@ For example: ((1 . cn-gb-2312) (2 . big5))." (defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number "Function called to sort the articles within a thread after it has been gathered together.") +(defvar gnus-summary-save-parts-type-history nil) +(defvar gnus-summary-save-parts-last-directory nil) + ;; Avoid highlighting in kill files. (defvar gnus-summary-inhibit-highlight nil) (defvar gnus-newsgroup-selected-overlay nil) @@ -2092,7 +2104,7 @@ The following commands are available: (make-local-hook 'pre-command-hook) (add-hook 'pre-command-hook 'gnus-set-global-variables nil t) (gnus-run-hooks 'gnus-summary-mode-hook) - (mm-enable-multibyte) + (mm-enable-multibyte-mule4) (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) (gnus-update-summary-mark-positions)) @@ -3300,7 +3312,9 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." (nnheader-nov-read-integer) ; chars (nnheader-nov-read-integer) ; lines (unless (eobp) - (nnheader-nov-field)) ; misc + (if (looking-at "Xref: ") + (goto-char (match-end 0))) + (nnheader-nov-field)) ; Xref (nnheader-nov-parse-extra)))) ; extra (widen)) @@ -4289,7 +4303,9 @@ If SELECT-ARTICLES, only select those articles from GROUP." (if (string-match "^[ \t]*$" input) number input))) (t number)) - (quit nil)))))) + (quit + (message "Quit getting the articles to read") + nil)))))) (setq select (if (stringp select) (string-to-number select) select)) (if (or (null select) (zerop select)) select @@ -4729,7 +4745,8 @@ The resulting hash table is returned, or nil if no Xrefs were found." ;; From. (progn (goto-char p) - (if (search-forward "\nfrom: " nil t) + (if (or (search-forward "\nfrom: " nil t) + (search-forward "\nfrom:" nil t)) (funcall gnus-decode-encoded-word-function (nnheader-header-value)) "(nobody)")) @@ -5388,7 +5405,10 @@ If FORCE (the prefix), also save the .newsrc file(s)." (when (gnus-buffer-live-p gnus-article-buffer) (save-excursion (set-buffer gnus-article-buffer) - (mm-destroy-parts gnus-article-mime-handles))) + (mm-destroy-parts gnus-article-mime-handles) + ;; Set it to nil for safety reason. + (setq gnus-article-mime-handle-alist nil) + (setq gnus-article-mime-handles nil))) (gnus-kill-save-kill-buffer) (gnus-async-halt-prefetch) (let* ((group gnus-newsgroup-name) @@ -5486,7 +5506,10 @@ If FORCE (the prefix), also save the .newsrc file(s)." (when (gnus-buffer-live-p gnus-article-buffer) (save-excursion (set-buffer gnus-article-buffer) - (mm-destroy-parts gnus-article-mime-handles))) + (mm-destroy-parts gnus-article-mime-handles) + ;; Set it to nil for safety reason. + (setq gnus-article-mime-handle-alist nil) + (setq gnus-article-mime-handles nil))) ;; If we have several article buffers, we kill them at exit. (unless gnus-single-article-buffer (gnus-kill-buffer gnus-article-buffer) @@ -5824,6 +5847,9 @@ Given a prefix, will force an `article' buffer configuration." (defun gnus-summary-display-article (article &optional all-header) "Display ARTICLE in article buffer." + (when (gnus-buffer-live-p gnus-article-buffer) + (with-current-buffer gnus-article-buffer + (mm-enable-multibyte-mule4))) (gnus-set-global-variables) (if (null article) nil @@ -5873,14 +5899,11 @@ be displayed." force) ;; The requested article is different from the current article. (progn - (when (gnus-buffer-live-p gnus-article-buffer) - (with-current-buffer gnus-article-buffer - (mm-enable-multibyte))) (gnus-summary-display-article article all-headers) (when (gnus-buffer-live-p gnus-article-buffer) - (with-current-buffer gnus-article-buffer + (with-current-buffer gnus-article-buffer (if (not gnus-article-decoded-p) ;; a local variable - (mm-disable-multibyte)))) + (mm-disable-multibyte-mule4)))) (when (or all-headers gnus-show-all-headers) (gnus-article-show-all-headers)) (gnus-article-set-window-start @@ -6859,7 +6882,8 @@ of what's specified by the `gnus-refer-thread-limit' variable." ((eq 'current gnus-refer-article-method) (list gnus-current-select-method)) ;; List of select methods. - ((not (stringp (cadr gnus-refer-article-method))) + ((not (and (symbolp (car gnus-refer-article-method)) + (assq (car gnus-refer-article-method) nnoo-definition-alist))) (let (out) (dolist (method gnus-refer-article-method) (push (if (eq 'current method) @@ -6909,7 +6933,10 @@ to guess what the document format is." ;; the parent article. (when (setq to-address (or (message-fetch-field "reply-to") (message-fetch-field "from"))) - (setq params (append (list (cons 'to-address to-address))))) + (setq params (append + (list (cons 'to-address + (funcall gnus-decode-encoded-word-function + to-address)))))) (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) (insert-buffer-substring gnus-original-article-buffer) ;; Remove lines that may lead nndoc to misinterpret the @@ -7249,7 +7276,10 @@ without any article massaging functions being run." (when (gnus-buffer-live-p gnus-article-buffer) (save-excursion (set-buffer gnus-article-buffer) - (mm-destroy-parts gnus-article-mime-handles))) + (mm-destroy-parts gnus-article-mime-handles) + ;; Set it to nil for safety reason. + (setq gnus-article-mime-handle-alist nil) + (setq gnus-article-mime-handles nil))) (gnus-summary-select-article nil 'force)))) (gnus-summary-goto-subject gnus-current-article) (gnus-summary-position-point)) @@ -7710,19 +7740,19 @@ This will be the case if the article has both been mailed and posted." (setq es (gnus-request-expire-articles expirable gnus-newsgroup-name))) (setq es (gnus-request-expire-articles - expirable gnus-newsgroup-name)))) - (unless total - (setq gnus-newsgroup-expirable es)) - ;; We go through the old list of expirable, and mark all - ;; really expired articles as nonexistent. - (unless (eq es expirable) ;If nothing was expired, we don't mark. - (let ((gnus-use-cache nil)) - (while expirable - (unless (memq (car expirable) es) - (when (gnus-data-find (car expirable)) - (gnus-summary-mark-article - (car expirable) gnus-canceled-mark))) - (setq expirable (cdr expirable))))) + expirable gnus-newsgroup-name))) + (unless total + (setq gnus-newsgroup-expirable es)) + ;; We go through the old list of expirable, and mark all + ;; really expired articles as nonexistent. + (unless (eq es expirable) ;If nothing was expired, we don't mark. + (let ((gnus-use-cache nil)) + (while expirable + (unless (memq (car expirable) es) + (when (gnus-data-find (car expirable)) + (gnus-summary-mark-article + (car expirable) gnus-canceled-mark))) + (setq expirable (cdr expirable)))))) (gnus-message 6 "Expiring articles...done"))))) (defun gnus-summary-expire-articles-now () @@ -7806,7 +7836,7 @@ groups." (gnus-summary-show-article t) (when (and (not raw) (gnus-buffer-live-p gnus-article-buffer)) (with-current-buffer gnus-article-buffer - (mm-enable-multibyte))) + (mm-enable-multibyte-mule4))) (if (equal gnus-newsgroup-name "nndraft:drafts") (setq raw t)) (gnus-article-edit-article @@ -7822,6 +7852,8 @@ groups." (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))) `(lambda (no-highlight) (let ((mail-parse-charset ',gnus-newsgroup-charset) + (message-options message-options) + (message-options-set-recipient) (mail-parse-ignored-charsets ',gnus-newsgroup-ignored-charsets)) ,(if (not raw) '(progn @@ -9098,7 +9130,7 @@ save those articles instead." (set-buffer gnus-original-article-buffer) (save-restriction (nnheader-narrow-to-headers) - (while methods + (while (and methods (not split-name)) (goto-char (point-min)) (setq method (pop methods)) (setq match (car method)) @@ -9117,7 +9149,7 @@ save those articles instead." (save-restriction (widen) (setq result (eval match))))) - (setq split-name (append (cdr method) split-name)) + (setq split-name (cdr method)) (cond ((stringp result) (push (expand-file-name result gnus-article-save-directory) @@ -9186,8 +9218,14 @@ save those articles instead." "Save parts matching TYPE to DIR. If REVERSE, save parts that do not match TYPE." (interactive - (list (read-string "Save parts of type: " "image/.*") - (read-file-name "Save to directory: " nil nil t) + (list (read-string "Save parts of type: " + (or (car gnus-summary-save-parts-type-history) + gnus-summary-save-parts-default-mime) + 'gnus-summary-save-parts-type-history) + (setq gnus-summary-save-parts-last-directory + (read-file-name "Save to directory: " + gnus-summary-save-parts-last-directory + nil t)) current-prefix-arg)) (gnus-summary-iterate n (let ((gnus-display-mime-function nil) @@ -9195,10 +9233,12 @@ If REVERSE, save parts that do not match TYPE." (gnus-summary-select-article)) (save-excursion (set-buffer gnus-article-buffer) - (let ((handles (or (mm-dissect-buffer) (mm-uu-dissect)))) + (let ((handles (or gnus-article-mime-handles + (mm-dissect-buffer) (mm-uu-dissect)))) (when handles (gnus-summary-save-parts-1 type dir handles reverse) - (mm-destroy-parts handles)))))) + (unless gnus-article-mime-handles ;; Don't destroy this case. + (mm-destroy-parts handles))))))) (defun gnus-summary-save-parts-1 (type dir handle reverse) (if (stringp (car handle))