From 138c0212ac4bc4708210ba4b3e0a4fad00a4dc5f Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 21 Aug 2011 22:10:49 +0000 Subject: [PATCH] Merge changes made in Gnus trunk. nnmail.el (nnmail-get-new-mail-1): If one mail source bugs out, continue on and do the clean-up phase (bug#9188). gnus-sum.el (gnus-summary-expire-articles): When expiring articles, just ignore groups that can't be opened instead of erroring out (bug#9225). gnus-art.el (gnus-article-update-date-headers): Flip the default to nil since some many people are fuddy-duddies. gnus-html.el (gnus-html-image-fetched): Don't cache zero-length images. --- lisp/gnus/ChangeLog | 13 ++++++++++ lisp/gnus/gnus-art.el | 2 +- lisp/gnus/gnus-html.el | 15 ++++++------ lisp/gnus/gnus-sum.el | 55 +++++++++++++++++++++--------------------- lisp/gnus/nnmail.el | 29 +++++++++++++--------- 5 files changed, 66 insertions(+), 48 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 4fc144b81b9..ad3e26f0f51 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,18 @@ 2011-08-21 Lars Magne Ingebrigtsen + * nnmail.el (nnmail-get-new-mail-1): If one mail source bugs out, + continue on and do the clean-up phase (bug#9188). + + * gnus-sum.el (gnus-summary-expire-articles): When expiring articles, + just ignore groups that can't be opened instead of erroring out + (bug#9225). + + * gnus-art.el (gnus-article-update-date-headers): Flip the default to + nil since some many people are fuddy-duddies. + + * gnus-html.el (gnus-html-image-fetched): Don't cache zero-length + images. + * nntp.el (nntp-authinfo-file): Mark as obsolete -- use auth-source instead. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c6e0180dadc..eaf0ed52f51 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -1039,7 +1039,7 @@ Some of these headers are updated automatically. See (item :tag "ISO8601 format" :value 'iso8601) (item :tag "User-defined" :value 'user-defined))) -(defcustom gnus-article-update-date-headers 1 +(defcustom gnus-article-update-date-headers nil "A number that says how often to update the date header (in seconds). If nil, don't update it at all." :version "24.1" diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index d3da6aab1b7..f443c4021e2 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -399,15 +399,16 @@ Use ALT-TEXT for the image string." (defun gnus-html-image-fetched (status buffer image) "Callback function called when image has been fetched." (unless (plist-get status :error) - (when gnus-html-image-automatic-caching - (url-store-in-cache (current-buffer))) (when (and (or (search-forward "\n\n" nil t) (search-forward "\r\n\r\n" nil t)) - (buffer-live-p buffer)) - (let ((data (buffer-substring (point) (point-max)))) - (with-current-buffer buffer - (let ((inhibit-read-only t)) - (gnus-html-put-image data (car image) (cadr image))))))) + (not (eobp))) + (when gnus-html-image-automatic-caching + (url-store-in-cache (current-buffer))) + (when (buffer-live-p buffer) + (let ((data (buffer-substring (point) (point-max)))) + (with-current-buffer buffer + (let ((inhibit-read-only t)) + (gnus-html-put-image data (car image) (cadr image)))))))) (kill-buffer (current-buffer))) (defun gnus-html-get-image-data (url) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 73ecffb090e..c01f91973a0 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -10287,34 +10287,33 @@ This will be the case if the article has both been mailed and posted." ;; There are expirable articles in this group, so we run them ;; through the expiry process. (gnus-message 6 "Expiring articles...") - (unless (gnus-check-group gnus-newsgroup-name) - (error "Can't open server for %s" gnus-newsgroup-name)) - ;; The list of articles that weren't expired is returned. - (save-excursion - (if expiry-wait - (let ((nnmail-expiry-wait-function nil) - (nnmail-expiry-wait expiry-wait)) - (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)) - (dolist (article expirable) - (when (and (not (memq article es)) - (gnus-data-find article)) - (gnus-summary-mark-article article gnus-canceled-mark) - (run-hook-with-args 'gnus-summary-article-expire-hook - 'delete - (gnus-data-header - (assoc article (gnus-data-list nil))) - gnus-newsgroup-name - nil - nil)))))) + (when (gnus-check-group gnus-newsgroup-name) + ;; The list of articles that weren't expired is returned. + (save-excursion + (if expiry-wait + (let ((nnmail-expiry-wait-function nil) + (nnmail-expiry-wait expiry-wait)) + (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)) + (dolist (article expirable) + (when (and (not (memq article es)) + (gnus-data-find article)) + (gnus-summary-mark-article article gnus-canceled-mark) + (run-hook-with-args 'gnus-summary-article-expire-hook + 'delete + (gnus-data-header + (assoc article (gnus-data-list nil))) + gnus-newsgroup-name + nil + nil))))))) (gnus-message 6 "Expiring articles...done"))))) (defun gnus-summary-expire-articles-now () diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index dc2080dee1a..d83467a1ed5 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -1842,18 +1842,23 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." ;; and fetch the mail from each. (while (setq source (pop fetching-sources)) (when (setq new - (mail-source-fetch - source - (gnus-byte-compile - `(lambda (file orig-file) - (nnmail-split-incoming - file ',(intern (format "%s-save-mail" method)) - ',spool-func - (or in-group - (if (equal file orig-file) - nil - (nnmail-get-split-group orig-file ',source))) - ',(intern (format "%s-active-number" method))))))) + (condition-case cond + (mail-source-fetch + source + (gnus-byte-compile + `(lambda (file orig-file) + (nnmail-split-incoming + file ',(intern (format "%s-save-mail" method)) + ',spool-func + (or in-group + (if (equal file orig-file) + nil + (nnmail-get-split-group orig-file + ',source))) + ',(intern (format "%s-active-number" method)))))) + ((error quit) + (message "Mail source %s failed: %s" source cond) + 0))) (incf total new) (incf i))) ;; If we did indeed read any incoming spools, we save all info. -- 2.39.2