From 13afbc7f8291e7cf78b50fa494b4cc9725530ecc Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sun, 9 Mar 2003 22:09:08 +0000 Subject: [PATCH] Synch to Oort Gnus 200303091823. --- lisp/ChangeLog | 29 +++++++++++++++++++++++++++++ lisp/gnus-agent.el | 35 +++++++++++++++++++++++------------ lisp/gnus-msg.el | 5 ++--- lisp/gnus-sum.el | 45 ++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 94 insertions(+), 20 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8fcd2bb..dcab063 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,32 @@ +2003-03-09 Jesper Harder + + * gnus-msg.el (gnus-inews-insert-archive-gcc): Don't use + kill-line. + +2003-03-09 Kevin Greiner + + * gnus-agent.el (gnus-agent-fetched-hook): New variable. Just + fixing the code to match the documentation. + (gnus-agent-fetch-selected-article): Replaced + gnus-summary-update-article-line with gnus-summary-update-line as + the former did not correctly recalculate the thread indentation. + (gnus-agent-find-parameter): The agent-predicate, if not found + anywhere else, defaults to the value of gnus-agent-predicate. + (gnus-agent-fetch-session): Fixed typo; now executes + gnus-agent-fetched-hook rather than the undocumented + gnus-agent-fetch-hook. + (gnus-agent-fetch-group-1): Removed part of 2003-03-06 fix. The + default agent predicate is now provided by + gnus-agent-find-parameter. + (gnus-agent-message): New macro. This macro avoids potentially + costly parameter evaluation when the message's level is too high + to display. + (gnus-agent-expire-group-1): Disabled undo tracking in temp + overview buffer. Uses new gnus-agent-message macro to reduce + overhead of optional messages. Reversed message levels to + emphasize percent completion messages. Detailed messages of + little use except when debugging code. + 2003-03-08 Teodor Zlatanov * spam.el (spam-ham-move-routine): use diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 24a704e..c192405 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -61,6 +61,11 @@ :group 'gnus-agent :type 'hook) +(defcustom gnus-agent-fetched-hook nil + "Hook run when finished fetching articles." + :group 'gnus-agent + :type 'hook) + (defcustom gnus-agent-handle-level gnus-level-subscribed "Groups on levels higher than this variable will be ignored by the Agent." :group 'gnus-agent @@ -1028,9 +1033,7 @@ This can be added to `gnus-select-article-hook' or (list gnus-current-article)) (setq gnus-newsgroup-undownloaded (delq gnus-current-article gnus-newsgroup-undownloaded)) - (gnus-summary-update-article-line - gnus-current-article - (gnus-summary-article-header gnus-current-article)))))) + (gnus-summary-update-line gnus-current-article))))) ;;; ;;; Internal functions @@ -1412,7 +1415,8 @@ variables. Returns the first non-nil value found." (agent-high-score . gnus-agent-high-score) (agent-days-until-old . gnus-agent-expire-days) (agent-enable-expiration - . gnus-agent-enable-expiration))))))) + . gnus-agent-enable-expiration) + (agent-predicate . gnus-agent-predicate))))))) (defun gnus-agent-fetch-headers (group &optional force) "Fetch interesting headers into the agent. The group's overview @@ -1774,7 +1778,7 @@ FILE and places the combined headers into `nntp-server-buffer'." (signal 'quit "Cannot fetch articles into the Gnus agent"))))))))) (pop methods)) - (run-hooks 'gnus-agent-fetch-hook) + (gnus-run-hooks 'gnus-agent-fetched-hook) (gnus-message 6 "Finished fetching articles into the Gnus agent")))) (defun gnus-agent-fetch-group-1 (group method) @@ -1842,8 +1846,7 @@ FILE and places the combined headers into `nntp-server-buffer'." (setq predicate (gnus-get-predicate - (or (gnus-agent-find-parameter group 'agent-predicate) - 'false))) + (gnus-agent-find-parameter group 'agent-predicate))) ;; If the selection predicate requires scoring, score each header (unless (memq predicate '(gnus-agent-true gnus-agent-false)) @@ -1984,6 +1987,9 @@ General format specifiers can also be used. See Info node (defvar gnus-category-mode-line-format "Gnus: %%b" "The format specification for the category mode line.") +(defvar gnus-agent-predicate 'false + "The selection predicate used when no other source is available.") + (defvar gnus-agent-short-article 100 "Articles that have fewer lines than this are short.") @@ -2438,6 +2444,10 @@ FORCE is equivalent to setting the expiration predicates to true." (kill-buffer overview)))) (gnus-message 4 "Expiry...done"))) +(defmacro gnus-agent-message (level &rest args) + `(if (<= ,level gnus-verbose) + (message ,@args))) + (defun gnus-agent-expire-group-1 (group overview active articles force) ;; Internal function - requires caller to have set ;; gnus-command-method, initialized overview buffer, and to have @@ -2552,6 +2562,7 @@ FORCE is equivalent to setting the expiration predicates to true." (set-buffer overview) (erase-buffer) + (buffer-disable-undo) (when (file-exists-p nov-file) (gnus-message 7 "gnus-agent-expire: Loading overview...") (nnheader-insert-file-contents nov-file) @@ -2630,7 +2641,7 @@ line." (point) nov-file))) len))))) (when (> new-completed completed) (setq completed new-completed) - (gnus-message 9 "%3d%% completed..." completed))) + (gnus-message 7 "%3d%% completed..." completed))) (let* ((entry (car dlist)) (article-number (nth 0 entry)) (fetch-date (nth 1 entry)) @@ -2640,7 +2651,7 @@ line." (point) nov-file))) (cond ;; Kept articles are unread, marked, or special. (keep - (gnus-message 10 + (gnus-agent-message 10 "gnus-agent-expire: Article %d: Kept %s article." article-number keep) (when fetch-date @@ -2648,7 +2659,7 @@ line." (point) nov-file))) (concat dir (number-to-string article-number))) (setf (nth 1 entry) nil) - (gnus-message 3 "gnus-agent-expire cleared \ + (gnus-agent-message 3 "gnus-agent-expire cleared \ download flag on article %d as the cached article file is missing." (caar dlist))) (unless marker @@ -2708,11 +2719,11 @@ missing NOV entry. Run gnus-agent-regenerate-group to restore it."))) (push (format "Removed %s article number from \ article alist" type) actions)) - (gnus-message 7 "gnus-agent-expire: Article %d: %s" + (gnus-agent-message 8 "gnus-agent-expire: Article %d: %s" article-number (mapconcat 'identity actions ", ")))) (t - (gnus-message + (gnus-agent-message 10 "gnus-agent-expire: Article %d: Article kept as \ expiration tests failed." article-number) (gnus-agent-append-to-list diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index f888be9..77ee13c 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -38,6 +38,7 @@ (require 'gnus-ems) (require 'message) (require 'gnus-art) +(require 'gnus-util) (defcustom gnus-post-method 'current "*Preferred method for posting USENET news. @@ -1955,9 +1956,7 @@ this is a reply." group))) (if (not (eq gcc-self-val 'none)) (insert "\n") - (progn - (beginning-of-line) - (kill-line)))) + (gnus-delete-line))) ;; Use the list of groups. (while (setq name (pop groups)) (let ((str (if (string-match ":" name) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 7538791..9eaa163 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -362,6 +362,23 @@ the first unread article." :group 'gnus-summary-maneuvering :type 'boolean) +(defcustom gnus-auto-goto-ignores 'unfetched + "*Says how to handle unfetched articles when maneuvering. + +This variable can either be the symbols `nil' (maneuver to any +article), `undownloaded' (maneuvering while unplugged ignores articles +that have not been fetched), `always-undownloaded' (maneuvering always +ignores articles that have not been fetched), `unfetched' (maneuvering +ignores articles whose headers have not been fetched). + +NOTE: The list of unfetched articles will always be nil when plugged +and, when unplugged, a subset of the undownloaded article list." + :group 'gnus-summary-maneuvering + :type '(choice (const :tag "None" nil) + (const :tag "Undownloaded when unplugged" undownloaded) + (const :tag "Undownloaded" always-undownloaded) + (const :tag "Unfetched" unfetched))) + (defcustom gnus-summary-check-current nil "*If non-nil, consider the current article when moving. The \"unread\" movement commands will stay on the same line if the @@ -1306,7 +1323,10 @@ end position and text.") "Sorted list of articles in the current newsgroup that can be processed.") (defvar gnus-newsgroup-unfetched nil - "Sorted list of articles in the current newsgroup whose headers have not been fetched into the agent.") + "Sorted list of articles in the current newsgroup whose headers have +not been fetched into the agent. + +This list will always be a subset of gnus-newsgroup-undownloaded.") (defvar gnus-newsgroup-undownloaded nil "List of articles in the current newsgroup that haven't been downloaded.") @@ -6034,7 +6054,7 @@ If EXCLUDE-GROUP, do not go to this group." (gnus-group-best-unread-group exclude-group)))) (defun gnus-summary-find-next (&optional unread article backward) - (if backward (gnus-summary-find-prev) + (if backward (gnus-summary-find-prev unread article) (let* ((dummy (gnus-summary-article-intangible-p)) (article (or article (gnus-summary-article-number))) (data (gnus-data-find-list article)) @@ -6049,7 +6069,14 @@ If EXCLUDE-GROUP, do not go to this group." (progn (while data (unless (memq (gnus-data-number (car data)) - gnus-newsgroup-unfetched) + (cond ((eq gnus-auto-goto-ignores 'always-undownloaded) + gnus-newsgroup-undownloaded) + (gnus-plugged + nil) + ((eq gnus-auto-goto-ignores 'unfetched) + gnus-newsgroup-unfetched) + ((eq gnus-auto-goto-ignores 'undownloaded) + gnus-newsgroup-undownloaded))) (when (gnus-data-unread-p (car data)) (setq result (car data) data nil))) @@ -6073,7 +6100,15 @@ If EXCLUDE-GROUP, do not go to this group." (if unread (progn (while data - (unless (memq (gnus-data-number (car data)) gnus-newsgroup-unfetched) + (unless (memq (gnus-data-number (car data)) + (cond ((eq gnus-auto-goto-ignores 'always-undownloaded) + gnus-newsgroup-undownloaded) + (gnus-plugged + nil) + ((eq gnus-auto-goto-ignores 'unfetched) + gnus-newsgroup-unfetched) + ((eq gnus-auto-goto-ignores 'undownloaded) + gnus-newsgroup-undownloaded))) (when (gnus-data-unread-p (car data)) (setq result (car data) data nil))) @@ -9867,7 +9902,7 @@ If NO-EXPIRE, auto-expiry will be inhibited." t) (defun gnus-summary-update-download-mark (article) - "Update the secondary (read, process, cache) mark." + "Update the download mark." (gnus-summary-update-mark (cond ((memq article gnus-newsgroup-undownloaded) gnus-undownloaded-mark) -- 1.7.10.4