From e7719ea1b23a7dc81993320f851c6e94d563dee4 Mon Sep 17 00:00:00 2001 From: Gnus developers Date: Sat, 7 Jan 2012 01:13:52 +0000 Subject: [PATCH] Merge changes made in Gnus trunk. 2012-01-06 Lars Magne Ingebrigtsen * gnus.texi (Group Parameters): Really note precedence. 2012-01-07 Lars Magne Ingebrigtsen * mm-decode.el (mm-interactively-view-part): Use `completing-read', since ido doesn't work on symbols (bug#9632). * gnus.el (gnus-group-fast-parameter): Use the same precedence rules when getting a single value as when getting all the values. This means that atoms like `gcc-self' work cumulatively, like variable settings, instead of getting the value from the last matching clause. (gnus-group-find-parameter): Protect against the group buffer not existing (bug#9585). 2012-01-06 Lars Magne Ingebrigtsen * gnus-start.el (gnus-activate-group): Document more parameters (bug#9694). * gnus-group.el (gnus-group-read-ephemeral-group): Doc clarification (bug#9692). * gnus-agent.el (gnus-agent-store-article): Tell the Agent when the article was fetched, so that it can be expired later (bug#9958). (gnus-agent-summary-fetch-series): Add doc string. (gnus-agent-summary-fetch-group): Don't remove tick and dormant marks (bug#9517). * nntp.el (nntp-retrieve-groups): Refuse to do retrieval when an async retrieval is happening. * gnus.el (gnus-parameters): Doc fix. 2012-01-06 Dave Abrahams (tiny change) * gnus-sum.el (gnus-summary-refer-thread): If the subtree is hidden, show the thread after expansion. 2012-01-06 Lars Magne Ingebrigtsen * gnus-art.el (article-narrow-to-head): If the head is completely empty, narrow to the empty region (bug#9764). * gnus-sum.el (gnus-summary-mark-article-as-unread): Mark articles as read, and then mark them as unread only when the unread mark is used. This makes `C-- T k' actually work, even though it's confusing. * gnus-win.el (gnus-all-windows-visible-p): Ensure that the buffer is alive before we try to find its window. 2012-01-06 Brian Sniffen (tiny change) * mm-decode.el (mm-display-external): Use a longer timeout for the deletion to allow slow programs to display the file. 2012-01-06 Lars Magne Ingebrigtsen * gnus-art.el (gnus-article-browse-delete-temp-files): Fix up the prompt to be less confusing. --- doc/misc/ChangeLog | 4 +++ doc/misc/gnus.texi | 7 ++++-- lisp/gnus/ChangeLog | 56 +++++++++++++++++++++++++++++++++++++++++ lisp/gnus/gnus-agent.el | 13 +++++++--- lisp/gnus/gnus-art.el | 22 ++++++++++------ lisp/gnus/gnus-group.el | 4 +-- lisp/gnus/gnus-int.el | 2 +- lisp/gnus/gnus-start.el | 6 ++++- lisp/gnus/gnus-sum.el | 4 ++- lisp/gnus/gnus-win.el | 1 + lisp/gnus/gnus.el | 23 +++++++++-------- lisp/gnus/mm-decode.el | 4 +-- lisp/gnus/nntp.el | 9 ++++++- 13 files changed, 124 insertions(+), 31 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 1494665c70..adb5bbbd66 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,7 @@ +2012-01-06 Lars Magne Ingebrigtsen + + * gnus.texi (Group Parameters): Really note precedence. + 2012-01-04 Lars Magne Ingebrigtsen * gnus.texi (Group Parameters): Note precedence. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 82f424e090..7728041c83 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -3180,14 +3180,17 @@ For example: (to-group . "\\1")) ("mail\\.me" - (gnus-use-scoring t)) + (gnus-use-scoring t)) ("list\\..*" (total-expire . t) (broken-reply-to . t)))) @end lisp -The first clause that matches the group name will be used. +All clauses that matches the group name will be used, but the last +setting ``wins''. So if you have two clauses that both match the +group name, and both set, say @code{display}, the last setting will +override the first. Parameters that are strings will be subjected to regexp substitution, as the @code{to-group} example shows. diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 70eb599c01..3a7e412dca 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,61 @@ +2012-01-07 Lars Magne Ingebrigtsen + + * mm-decode.el (mm-interactively-view-part): Use `completing-read', + since ido doesn't work on symbols (bug#9632). + + * gnus.el (gnus-group-fast-parameter): Use the same precedence rules + when getting a single value as when getting all the values. This means + that atoms like `gcc-self' work cumulatively, like variable settings, + instead of getting the value from the last matching clause. + (gnus-group-find-parameter): Protect against the group buffer not + existing (bug#9585). + +2012-01-06 Lars Magne Ingebrigtsen + + * gnus-start.el (gnus-activate-group): Document more parameters + (bug#9694). + + * gnus-group.el (gnus-group-read-ephemeral-group): Doc clarification + (bug#9692). + + * gnus-agent.el (gnus-agent-store-article): Tell the Agent when the + article was fetched, so that it can be expired later (bug#9958). + (gnus-agent-summary-fetch-series): Add doc string. + (gnus-agent-summary-fetch-group): Don't remove tick and dormant marks + (bug#9517). + + * nntp.el (nntp-retrieve-groups): Refuse to do retrieval when an async + retrieval is happening. + + * gnus.el (gnus-parameters): Doc fix. + +2012-01-06 Dave Abrahams (tiny change) + + * gnus-sum.el (gnus-summary-refer-thread): If the subtree is hidden, + show the thread after expansion. + +2012-01-06 Lars Magne Ingebrigtsen + + * gnus-art.el (article-narrow-to-head): If the head is completely + empty, narrow to the empty region (bug#9764). + + * gnus-sum.el (gnus-summary-mark-article-as-unread): Mark articles as + read, and then mark them as unread only when the unread mark is used. + This makes `C-- T k' actually work, even though it's confusing. + + * gnus-win.el (gnus-all-windows-visible-p): Ensure that the buffer is + alive before we try to find its window. + +2012-01-06 Brian Sniffen (tiny change) + + * mm-decode.el (mm-display-external): Use a longer timeout for the + deletion to allow slow programs to display the file. + 2012-01-06 Lars Magne Ingebrigtsen + * gnus-art.el (gnus-article-browse-delete-temp-files): Fix up the + prompt to be less confusing. + * gnus-msg.el (gnus-summary-reply): Do not give a `switch-to-buffer' argument to `message-reply'. This broke `special-display-*' frame pop-uping (bug#10238). diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 5e73432a3c..70772bb1d0 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -1181,6 +1181,7 @@ downloadable." (gnus-summary-position-point))) (defun gnus-agent-summary-fetch-series () + "Fetch the process-marked articles into the Agent." (interactive) (when gnus-newsgroup-processable (setq gnus-newsgroup-downloadable @@ -1228,8 +1229,9 @@ Optional arg ALL, if non-nil, means to fetch all articles." (cond (gnus-agent-mark-unread-after-downloaded (setq gnus-newsgroup-downloadable (delq article gnus-newsgroup-downloadable)) - - (gnus-summary-mark-article article gnus-unread-mark)) + (when (and (not (member article gnus-newsgroup-dormant)) + (not (member article gnus-newsgroup-marked))) + (gnus-summary-mark-article article gnus-unread-mark))) (was-marked-downloadable (gnus-summary-set-agent-mark article t))) (when (gnus-summary-goto-subject article nil t) @@ -3888,7 +3890,12 @@ has been fetched." (coding-system-for-write gnus-cache-coding-system)) (when (not (file-exists-p file)) (gnus-make-directory (file-name-directory file)) - (write-region (point-min) (point-max) file nil 'silent)))) + (write-region (point-min) (point-max) file nil 'silent) + ;; Tell the Agent when the article was fetched, so that it can + ;; be expired later. + (gnus-agent-load-alist group) + (gnus-agent-save-alist group (list article) + (time-to-days (current-time)))))) (defun gnus-agent-regenerate-group (group &optional reread) "Regenerate GROUP. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index cd99cdb9d5..b282afd961 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2785,10 +2785,11 @@ summary buffer." (or how (setq how gnus-article-browse-delete-temp)) (if (eq how 'ask) (let ((files (length gnus-article-browse-html-temp-list))) - (gnus-y-or-n-p (format - "Delete all %s temporary HTML file%s? " - files - (if (> files 1) "s" "")))) + (gnus-y-or-n-p + (if (= files 1) + "Delete the temporary HTML file? " + (format "Delete all %s temporary HTML files? " + files)))) how))) (dolist (file gnus-article-browse-html-temp-list) (cond ((file-directory-p file) @@ -3239,9 +3240,16 @@ always hide." Point is left at the beginning of the narrowed-to region." (narrow-to-region (goto-char (point-min)) - (if (search-forward "\n\n" nil 1) - (1- (point)) - (point-max))) + (cond + ;; Absolutely no headers displayed. + ((looking-at "\n") + (point)) + ;; Normal headers. + ((search-forward "\n\n" nil 1) + (1- (point))) + ;; Nothing but headers. + (t + (point-max)))) (goto-char (point-min))) (defun article-goto-body () diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 9d4f29487a..3327bbea5a 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2277,8 +2277,8 @@ confirmation is required." number) "Read GROUP from METHOD as an ephemeral group. If ACTIVATE, request the group first. -If QUIT-CONFIG, use that window configuration when exiting from the -ephemeral group. +If QUIT-CONFIG, use that Gnus window configuration name when +exiting from the ephemeral group. If REQUEST-ONLY, don't actually read the group; just request it. If SELECT-ARTICLES, only select those articles. If PARAMETERS, use those as the group parameters. diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 95c8a4431b..20add470ab 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -396,7 +396,7 @@ If it is down, start it up (again)." result)) (defun gnus-request-compact (gnus-command-method) - "Request groups compaction from GNUS-COMMAND-METHOD." + "Request groups compaction from GNUS-COMMAND-METHOD." (when (stringp gnus-command-method) (setq gnus-command-method (gnus-server-to-method gnus-command-method))) (funcall (gnus-get-function gnus-command-method 'request-compact) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 60ca5aee37..07409162ab 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -1451,7 +1451,11 @@ newsgroup." (defun gnus-activate-group (group &optional scan dont-check method dont-sub-check) "Check whether a group has been activated or not. -If SCAN, request a scan of that group as well." +If SCAN, request a scan of that group as well. If METHOD, use +that select method instead of determining the method based on the +group name. If DONT-CHECK, don't check check whether the group +actually exists. If DONT-SUB-CHECK or DONT-CHECK, don't let the +backend check whether the group actually exists." (let ((method (or method (inline (gnus-find-method-for-group group)))) active) (and (inline (gnus-check-server method)) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 2c8c2ed2ee..916654c59a 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9032,7 +9032,8 @@ non-numeric or nil fetch the number specified by the 'gnus-article-sort-by-number))) (setq gnus-newsgroup-articles (gnus-sorted-nunion gnus-newsgroup-articles (nreverse article-ids))) - (gnus-summary-limit-include-thread id)))) + (gnus-summary-limit-include-thread id))) + (gnus-summary-show-thread)) (defun gnus-summary-refer-article (message-id) "Fetch an article specified by MESSAGE-ID." @@ -10886,6 +10887,7 @@ If NO-EXPIRE, auto-expiry will be inhibited." (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)) (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads)) + (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) (cond ((= mark gnus-ticked-mark) (setq gnus-newsgroup-marked (gnus-add-to-sorted-list gnus-newsgroup-marked diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index 483adb94db..579210c613 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -464,6 +464,7 @@ should have point." (unless buffer (error "Invalid buffer type: %s" type)) (if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer))) + (buffer-live-p buf) (setq win (gnus-get-buffer-window buf t))) (if (memq 'point split) (setq all-visible win)) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 459f4cc881..2d48f515f3 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -1146,9 +1146,7 @@ For example: (display . all)) (\"mail\\\\.me\" (gnus-use-scoring t)) (\"list\\\\..*\" (total-expire . t) - (broken-reply-to . t))) - -The first clause that matches the group name will be used." + (broken-reply-to . t)))" :version "22.1" :group 'gnus-group-various :type '(repeat (cons regexp @@ -3862,13 +3860,14 @@ The function `gnus-group-find-parameter' will do that for you." ;; The car is regexp matching for matching the group name. (when (string-match (car head) group) ;; The cdr is the parameters. - (setq result (gnus-group-parameter-value (cdr head) - symbol allow-list)) - (when result - ;; Expand if necessary. - (if (and (stringp result) (string-match "\\\\[0-9&]" result)) - (setq result (gnus-expand-group-parameter (car head) - result group)))))) + (let ((this-result + (gnus-group-parameter-value (cdr head) symbol allow-list t))) + (when this-result + (setq result (car this-result)) + ;; Expand if necessary. + (if (and (stringp result) (string-match "\\\\[0-9&]" result)) + (setq result (gnus-expand-group-parameter + (car head) result group))))))) ;; Done. result)))) @@ -3878,7 +3877,9 @@ If SYMBOL, return the value of that symbol in the group parameters. If you call this function inside a loop, consider using the faster `gnus-group-fast-parameter' instead." - (with-current-buffer gnus-group-buffer + (with-current-buffer (if (buffer-live-p gnus-group-buffer) + gnus-group-buffer + (current-buffer)) (if symbol (gnus-group-fast-parameter group symbol allow-list) (nconc diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index ec8dd5bf8c..10e0fa2861 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -942,7 +942,7 @@ external if displayed external." ;; In particular, the timer object (which is ;; a vector in Emacs but is a list in XEmacs) ;; requires that it is lexically scoped. - (timer (run-at-time 2.0 nil 'ignore))) + (timer (run-at-time 30.0 nil 'ignore))) (if (featurep 'xemacs) (lambda (process state) (when (eq 'exit (process-status process)) @@ -1353,7 +1353,7 @@ Use CMD as the process." (mailcap-mime-info type 'all))) (method (let ((minibuffer-local-completion-map mm-viewer-completion-map)) - (gnus-completing-read "Viewer" methods)))) + (completing-read "Viewer" methods)))) (when (string= method "") (error "No method given")) (if (string-match "^[^% \t]+$" method) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index e089dfbe10..db9d9e252b 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -847,7 +847,14 @@ command whose response triggered the error." "Retrieve group info on GROUPS." (nntp-with-open-group nil server - (when (nntp-find-connection-buffer nntp-server-buffer) + (when (and (nntp-find-connection-buffer nntp-server-buffer) + (with-current-buffer + (nntp-find-connection-buffer nntp-server-buffer) + (if (not nntp-retrieval-in-progress) + t + (message "Warning: Refusing to do retrieval from %s because a retrieval is already happening" + server) + nil))) (catch 'done (save-excursion ;; Erase nntp-server-buffer before nntp-inhibit-erase. -- 2.39.2