+2003-03-09 Jesper Harder <harder@ifa.au.dk>
+
+ * gnus-msg.el (gnus-inews-insert-archive-gcc): Don't use
+ kill-line.
+
+2003-03-09 Kevin Greiner <kgreiner@xpediantsolutions.com>
+
+ * 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 <tzz@lifelogs.com>
* spam.el (spam-ham-move-routine): use
: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
(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
(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
(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)
(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))
(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.")
(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
(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)
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))
(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
(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
(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
(require 'gnus-ems)
(require 'message)
(require 'gnus-art)
+(require 'gnus-util)
(defcustom gnus-post-method 'current
"*Preferred method for posting USENET news.
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)
: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
"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.")
(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))
(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)))
(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)))
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)