comparison lisp/gnus/gnus-agent.el @ 33401:bcba582cbfe5

(gnus-agent-confirmation-function): Add :version. (gnus-agent-lib-file, gnus-agent-load-alist) (gnus-agent-save-alist, gnus-agent-article-name): Use expand-file-name.
author Dave Love <fx@gnu.org>
date Fri, 10 Nov 2000 23:03:16 +0000
parents 2e19cd4c5909
children a26d9b55abb6
comparison
equal deleted inserted replaced
33400:42c1ba3caf9c 33401:bcba582cbfe5
1 ;;; gnus-agent.el --- unplugged support for Gnus 1 ;;; gnus-agent.el --- unplugged support for Gnus
2 ;; Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2 ;; Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
5 ;; Maintainer: bugs@gnus.org
6 ;; This file is part of GNU Emacs. 5 ;; This file is part of GNU Emacs.
7 6
8 ;; GNU Emacs is free software; you can redistribute it and/or modify 7 ;; GNU Emacs is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by 8 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option) 9 ;; the Free Software Foundation; either version 2, or (at your option)
81 :group 'gnus-agent 80 :group 'gnus-agent
82 :type 'hook) 81 :type 'hook)
83 82
84 (defcustom gnus-agent-confirmation-function 'y-or-n-p 83 (defcustom gnus-agent-confirmation-function 'y-or-n-p
85 "Function to confirm when error happens." 84 "Function to confirm when error happens."
85 :version "21.1"
86 :group 'gnus-agent 86 :group 'gnus-agent
87 :type 'function) 87 :type 'function)
88 88
89 (defcustom gnus-agent-synchronize-flags 'ask 89 (defcustom gnus-agent-synchronize-flags 'ask
90 "Indicate if flags are synchronized when you plug in. 90 "Indicate if flags are synchronized when you plug in.
91 If this is `ask' the hook will query the user." 91 If this is `ask' the hook will query the user."
92 :version "21.1"
92 :type '(choice (const :tag "Always" t) 93 :type '(choice (const :tag "Always" t)
93 (const :tag "Never" nil) 94 (const :tag "Never" nil)
94 (const :tag "Ask" ask)) 95 (const :tag "Ask" ask))
95 :group 'gnus-agent) 96 :group 'gnus-agent)
96 97
169 (nnheader-concat gnus-agent-directory 170 (nnheader-concat gnus-agent-directory
170 (nnheader-translate-file-chars (gnus-agent-method)) "/")) 171 (nnheader-translate-file-chars (gnus-agent-method)) "/"))
171 172
172 (defun gnus-agent-lib-file (file) 173 (defun gnus-agent-lib-file (file)
173 "The full path of the Gnus agent library FILE." 174 "The full path of the Gnus agent library FILE."
174 (concat (gnus-agent-directory) "agent.lib/" file)) 175 (expand-file-name file
176 (file-name-as-directory
177 (expand-file-name "agent.lib" (gnus-agent-directory)))))
175 178
176 ;;; Fetching setup functions. 179 ;;; Fetching setup functions.
177 180
178 (defun gnus-agent-start-fetch () 181 (defun gnus-agent-start-fetch ()
179 "Initialize data structures for efficient fetching." 182 "Initialize data structures for efficient fetching."
1041 (defun gnus-agent-load-alist (group &optional dir) 1044 (defun gnus-agent-load-alist (group &optional dir)
1042 "Load the article-state alist for GROUP." 1045 "Load the article-state alist for GROUP."
1043 (setq gnus-agent-article-alist 1046 (setq gnus-agent-article-alist
1044 (gnus-agent-read-file 1047 (gnus-agent-read-file
1045 (if dir 1048 (if dir
1046 (concat dir ".agentview") 1049 (expand-file-name ".agentview" dir)
1047 (gnus-agent-article-name ".agentview" group))))) 1050 (gnus-agent-article-name ".agentview" group)))))
1048 1051
1049 (defun gnus-agent-save-alist (group &optional articles state dir) 1052 (defun gnus-agent-save-alist (group &optional articles state dir)
1050 "Save the article-state alist for GROUP." 1053 "Save the article-state alist for GROUP."
1051 (let ((file-name-coding-system nnmail-pathname-coding-system)) 1054 (let ((file-name-coding-system nnmail-pathname-coding-system))
1052 (with-temp-file (if dir 1055 (with-temp-file (if dir
1053 (concat dir ".agentview") 1056 (expand-file-name ".agentview" dir)
1054 (gnus-agent-article-name ".agentview" group)) 1057 (gnus-agent-article-name ".agentview" group))
1055 (princ (setq gnus-agent-article-alist 1058 (princ (setq gnus-agent-article-alist
1056 (nconc gnus-agent-article-alist 1059 (nconc gnus-agent-article-alist
1057 (mapcar (lambda (article) (cons article state)) 1060 (mapcar (lambda (article) (cons article state))
1058 articles))) 1061 articles)))
1059 (current-buffer)) 1062 (current-buffer))
1060 (insert "\n")))) 1063 (insert "\n"))))
1061 1064
1062 (defun gnus-agent-article-name (article group) 1065 (defun gnus-agent-article-name (article group)
1063 (concat (gnus-agent-directory) (gnus-agent-group-path group) "/" 1066 (expand-file-name (if (stringp article) article (string-to-number article))
1064 (if (stringp article) article (string-to-number article)))) 1067 (file-name-as-directory
1068 (expand-file-name (gnus-agent-group-path group)
1069 (gnus-agent-directory)))))
1065 1070
1066 (defun gnus-agent-batch-confirmation (msg) 1071 (defun gnus-agent-batch-confirmation (msg)
1067 "Show error message and return t." 1072 "Show error message and return t."
1068 (gnus-message 1 msg) 1073 (gnus-message 1 msg)
1069 t) 1074 t)