;; Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
-;; Maintainer: bugs@gnus.org
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
(defcustom gnus-agent-confirmation-function 'y-or-n-p
"Function to confirm when error happens."
+ :version "21.1"
:group 'gnus-agent
:type 'function)
(defcustom gnus-agent-synchronize-flags 'ask
"Indicate if flags are synchronized when you plug in.
If this is `ask' the hook will query the user."
+ :version "21.1"
:type '(choice (const :tag "Always" t)
(const :tag "Never" nil)
(const :tag "Ask" ask))
(cadr gnus-command-method))))
(defsubst gnus-agent-directory ()
- "Path of the Gnus agent directory."
+ "The name of the Gnus agent directory."
(nnheader-concat gnus-agent-directory
(nnheader-translate-file-chars (gnus-agent-method)) "/"))
(defun gnus-agent-lib-file (file)
- "The full path of the Gnus agent library FILE."
- (concat (gnus-agent-directory) "agent.lib/" file))
+ "The full name of the Gnus agent library FILE."
+ (expand-file-name file
+ (file-name-as-directory
+ (expand-file-name "agent.lib" (gnus-agent-directory)))))
;;; Fetching setup functions.
(save-restriction
(message-narrow-to-headers)
(let* ((gcc (mail-fetch-field "gcc" nil t))
- (methods (and gcc
+ (methods (and gcc
(mapcar 'gnus-inews-group-method
(message-unquote-tokens
- (message-tokenize-header
+ (message-tokenize-header
gcc " ,")))))
covered)
(while (and (not covered) methods)
(when (or (and gnus-agent-synchronize-flags
(not (eq gnus-agent-synchronize-flags 'ask)))
(and (eq gnus-agent-synchronize-flags 'ask)
- (gnus-y-or-n-p (format "Synchronize flags on server `%s'? "
+ (gnus-y-or-n-p (format "Synchronize flags on server `%s'? "
(cadr method)))))
(gnus-agent-synchronize-flags-server method)))
(gnus-make-directory (file-name-directory file))
(with-temp-file file
;; Emacs got problem to match non-ASCII group in multibyte buffer.
- (mm-disable-multibyte)
+ (mm-disable-multibyte)
(when (file-exists-p file)
(nnheader-insert-file-contents file))
(goto-char (point-min))
(delete-char 1))))))
(defun gnus-agent-group-path (group)
- "Translate GROUP into a path."
+ "Translate GROUP into a file name."
(if nnmail-use-long-file-names
(gnus-group-real-name group)
(nnheader-translate-file-chars
(nnheader-replace-chars-in-string
(nnheader-replace-duplicate-chars-in-string
- (nnheader-replace-chars-in-string
+ (nnheader-replace-chars-in-string
(gnus-group-real-name group)
?/ ?_)
?. ?_)
(with-temp-buffer
(let (article)
(while (setq article (pop articles))
- (when (or
- (gnus-backlog-request-article group article
+ (when (or
+ (gnus-backlog-request-article group article
nntp-server-buffer)
(gnus-request-article article group))
(goto-char (point-max))
(setq gnus-agent-article-alist
(gnus-agent-read-file
(if dir
- (concat dir ".agentview")
+ (expand-file-name ".agentview" dir)
(gnus-agent-article-name ".agentview" group)))))
(defun gnus-agent-save-alist (group &optional articles state dir)
"Save the article-state alist for GROUP."
(let ((file-name-coding-system nnmail-pathname-coding-system))
(with-temp-file (if dir
- (concat dir ".agentview")
+ (expand-file-name ".agentview" dir)
(gnus-agent-article-name ".agentview" group))
(princ (setq gnus-agent-article-alist
(nconc gnus-agent-article-alist
(insert "\n"))))
(defun gnus-agent-article-name (article group)
- (concat (gnus-agent-directory) (gnus-agent-group-path group) "/"
- (if (stringp article) article (string-to-number article))))
+ (expand-file-name (if (stringp article) article (string-to-number article))
+ (file-name-as-directory
+ (expand-file-name (gnus-agent-group-path group)
+ (gnus-agent-directory)))))
(defun gnus-agent-batch-confirmation (msg)
"Show error message and return t."
(while (setq group (pop groups))
(when (<= (gnus-group-level group) gnus-agent-handle-level)
(gnus-agent-fetch-group-1 group gnus-command-method))))))
- (error
+ (error
(unless (funcall gnus-agent-confirmation-function
(format "Error (%s). Continue? " err))
- (error "Cannot fetch articles into the Gnus agent.")))
- (quit
+ (error "Cannot fetch articles into the Gnus agent")))
+ (quit
(unless (funcall gnus-agent-confirmation-function
(format "Quit (%s). Continue? " err))
(signal 'quit "Cannot fetch articles into the Gnus agent."))))
(setq gnus-newsgroup-dependencies
(make-vector (length articles) 0))
(setq gnus-newsgroup-headers
- (gnus-get-newsgroup-headers-xover articles nil nil
+ (gnus-get-newsgroup-headers-xover articles nil nil
group))
;; `gnus-agent-overview-buffer' may be killed for
;; timeout reason. If so, recreate it.
(when (file-exists-p (gnus-agent-lib-file "active"))
(with-temp-buffer
(nnheader-insert-file-contents (gnus-agent-lib-file "active"))
- (gnus-active-to-gnus-format
+ (gnus-active-to-gnus-format
gnus-command-method
(setq orig (gnus-make-hashtable
(count-lines (point-min) (point-max))))))
(or (not (numberp
(setq art (read (current-buffer)))))
(< art article)))
- (if (and (numberp art)
+ (if (and (numberp art)
(file-exists-p
(gnus-agent-article-name
(number-to-string art) group)))