1 ;;; gnus-agent.el --- unplugged support for Gnus
3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
21 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
37 (if (featurep 'xemacs)
43 (autoload 'gnus-server-update-server "gnus-srvr")
44 (autoload 'gnus-agent-customize-category "gnus-cus")
47 (defcustom gnus-agent-directory (nnheader-concat gnus-directory "agent/")
48 "Where the Gnus agent will store its files."
52 (defcustom gnus-agent-plugged-hook nil
53 "Hook run when plugging into the network."
57 (defcustom gnus-agent-unplugged-hook nil
58 "Hook run when unplugging from the network."
62 (defcustom gnus-agent-fetched-hook nil
63 "Hook run when finished fetching articles."
68 (defcustom gnus-agent-handle-level gnus-level-subscribed
69 "Groups on levels higher than this variable will be ignored by the Agent."
73 (defcustom gnus-agent-expire-days 7
74 "Read articles older than this will be expired.
75 If you wish to disable Agent expiring, see `gnus-agent-enable-expiration'."
77 :type '(number :tag "days"))
79 (defcustom gnus-agent-expire-all nil
80 "If non-nil, also expire unread, ticked and dormant articles.
81 If nil, only read articles will be expired."
85 (defcustom gnus-agent-group-mode-hook nil
86 "Hook run in Agent group minor modes."
90 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
91 (when (featurep 'xemacs)
92 (add-hook 'gnus-agent-group-mode-hook 'gnus-xmas-agent-group-menu-add))
94 (defcustom gnus-agent-summary-mode-hook nil
95 "Hook run in Agent summary minor modes."
99 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
100 (when (featurep 'xemacs)
101 (add-hook 'gnus-agent-summary-mode-hook 'gnus-xmas-agent-summary-menu-add))
103 (defcustom gnus-agent-server-mode-hook nil
104 "Hook run in Agent summary minor modes."
108 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
109 (when (featurep 'xemacs)
110 (add-hook 'gnus-agent-server-mode-hook 'gnus-xmas-agent-server-menu-add))
112 (defcustom gnus-agent-confirmation-function 'y-or-n-p
113 "Function to confirm when error happens."
118 (defcustom gnus-agent-synchronize-flags nil
119 "Indicate if flags are synchronized when you plug in.
120 If this is `ask' the hook will query the user."
122 :type '(choice (const :tag "Always" t)
123 (const :tag "Never" nil)
124 (const :tag "Ask" ask))
127 (defcustom gnus-agent-go-online 'ask
128 "Indicate if offline servers go online when you plug in.
129 If this is `ask' the hook will query the user."
131 :type '(choice (const :tag "Always" t)
132 (const :tag "Never" nil)
133 (const :tag "Ask" ask))
136 (defcustom gnus-agent-mark-unread-after-downloaded t
137 "Indicate whether to mark articles unread after downloaded."
142 (defcustom gnus-agent-download-marks '(download)
143 "Marks for downloading."
145 :type '(repeat (symbol :tag "Mark"))
148 (defcustom gnus-agent-consider-all-articles nil
149 "When non-nil, the agent will let the agent predicate decide
150 whether articles need to be downloaded or not, for all articles. When
151 nil, the default, the agent will only let the predicate decide
152 whether unread articles are downloaded or not. If you enable this,
153 groups with large active ranges may open slower and you may also want
154 to look into the agent expiry settings to block the expiration of
155 read articles as they would just be downloaded again."
160 (defcustom gnus-agent-max-fetch-size 10000000 ;; 10 Mb
161 "Chunk size for `gnus-agent-fetch-session'.
162 The function will split its article fetches into chunks smaller than
168 (defcustom gnus-agent-enable-expiration 'ENABLE
169 "The default expiration state for each group.
170 When set to ENABLE, the default, `gnus-agent-expire' will expire old
171 contents from a group's local storage. This value may be overridden
172 to disable expiration in specific categories, topics, and groups. Of
173 course, you could change gnus-agent-enable-expiration to DISABLE then
174 enable expiration per categories, topics, and groups."
177 :type '(radio (const :format "Enable " ENABLE)
178 (const :format "Disable " DISABLE)))
180 (defcustom gnus-agent-expire-unagentized-dirs t
181 "*Whether expiration should expire in unagentized directories.
182 Have gnus-agent-expire scan the directories under
183 \(gnus-agent-directory) for groups that are no longer agentized.
184 When found, offer to remove them."
189 (defcustom gnus-agent-auto-agentize-methods '(nntp nnimap)
190 "Initially, all servers from these methods are agentized.
191 The user may remove or add servers using the Server buffer.
192 See Info node `(gnus)Server Buffer'."
194 :type '(repeat symbol)
197 (defcustom gnus-agent-queue-mail t
198 "Whether and when outgoing mail should be queued by the agent.
199 When `always', always queue outgoing mail. When nil, never
200 queue. Otherwise, queue if and only if unplugged."
203 :type '(radio (const :format "Always" always)
204 (const :format "Never" nil)
205 (const :format "When plugged" t)))
207 (defcustom gnus-agent-prompt-send-queue nil
208 "If non-nil, `gnus-group-send-queue' will prompt if called when
214 ;;; Internal variables
216 (defvar gnus-agent-history-buffers nil)
217 (defvar gnus-agent-buffer-alist nil)
218 (defvar gnus-agent-article-alist nil
219 "An assoc list identifying the articles whose headers have been fetched.
220 If successfully fetched, these headers will be stored in the group's overview
221 file. The key of each assoc pair is the article ID, the value of each assoc
222 pair is a flag indicating whether the identified article has been downloaded
223 \(gnus-agent-fetch-articles sets the value to the day of the download).
225 1) The last element of this list can not be expired as some
226 routines (for example, get-agent-fetch-headers) use the last
227 value to track which articles have had their headers retrieved.
228 2) The function `gnus-agent-regenerate' may destructively modify the value.")
229 (defvar gnus-agent-group-alist nil)
230 (defvar gnus-category-alist nil)
231 (defvar gnus-agent-current-history nil)
232 (defvar gnus-agent-overview-buffer nil)
233 (defvar gnus-category-predicate-cache nil)
234 (defvar gnus-category-group-cache nil)
235 (defvar gnus-agent-spam-hashtb nil)
236 (defvar gnus-agent-file-name nil)
237 (defvar gnus-agent-send-mail-function nil)
238 (defvar gnus-agent-file-coding-system 'raw-text)
239 (defvar gnus-agent-file-loading-cache nil)
240 (defvar gnus-agent-total-fetched-hashtb nil)
241 (defvar gnus-agent-inhibit-update-total-fetched-for nil)
242 (defvar gnus-agent-need-update-total-fetched-for nil)
245 (defvar gnus-headers)
252 (defun gnus-open-agent ()
254 (gnus-agent-read-servers)
256 (gnus-agent-create-buffer)
257 (add-hook 'gnus-group-mode-hook 'gnus-agent-mode)
258 (add-hook 'gnus-summary-mode-hook 'gnus-agent-mode)
259 (add-hook 'gnus-server-mode-hook 'gnus-agent-mode))
261 (defun gnus-agent-create-buffer ()
262 (if (gnus-buffer-live-p gnus-agent-overview-buffer)
264 (setq gnus-agent-overview-buffer
265 (gnus-get-buffer-create " *Gnus agent overview*"))
266 (with-current-buffer gnus-agent-overview-buffer
267 (mm-enable-multibyte))
270 (gnus-add-shutdown 'gnus-close-agent 'gnus)
272 (defun gnus-close-agent ()
273 (setq gnus-category-predicate-cache nil
274 gnus-category-group-cache nil
275 gnus-agent-spam-hashtb nil)
276 (gnus-kill-buffer gnus-agent-overview-buffer))
279 ;;; Utility functions
282 (defmacro gnus-agent-with-refreshed-group (group &rest body)
283 "Performs the body then updates the group's line in the group
284 buffer. Automatically blocks multiple updates due to recursion."
285 `(prog1 (let ((gnus-agent-inhibit-update-total-fetched-for t)) ,@body)
286 (when (and gnus-agent-need-update-total-fetched-for
287 (not gnus-agent-inhibit-update-total-fetched-for))
289 (set-buffer gnus-group-buffer)
290 (setq gnus-agent-need-update-total-fetched-for nil)
291 (gnus-group-update-group ,group t)))))
293 (defun gnus-agent-read-file (file)
294 "Load FILE and do a `read' there."
297 (nnheader-insert-file-contents file)
298 (goto-char (point-min))
299 (read (current-buffer)))))
301 (defsubst gnus-agent-method ()
302 (concat (symbol-name (car gnus-command-method)) "/"
303 (if (equal (cadr gnus-command-method) "")
305 (cadr gnus-command-method))))
307 (defsubst gnus-agent-directory ()
308 "The name of the Gnus agent directory."
309 (nnheader-concat gnus-agent-directory
310 (nnheader-translate-file-chars (gnus-agent-method)) "/"))
312 (defun gnus-agent-lib-file (file)
313 "The full name of the Gnus agent library FILE."
314 (expand-file-name file
315 (file-name-as-directory
316 (expand-file-name "agent.lib" (gnus-agent-directory)))))
318 (defun gnus-agent-cat-set-property (category property value)
320 (setcdr (or (assq property category)
321 (let ((cell (cons property nil)))
322 (setcdr category (cons cell (cdr category)))
324 (let ((category category))
325 (while (cond ((eq property (caadr category))
326 (setcdr category (cddr category))
329 (setq category (cdr category)))))))
333 (defmacro gnus-agent-cat-defaccessor (name prop-name)
334 "Define accessor and setter methods for manipulating a list of the form
335 \(NAME (PROPERTY1 VALUE1) ... (PROPERTY_N VALUE_N)).
336 Given the call (gnus-agent-cat-defaccessor func PROPERTY1), the list may be
337 manipulated as follows:
338 (func LIST): Returns VALUE1
339 (setf (func LIST) NEW_VALUE1): Replaces VALUE1 with NEW_VALUE1."
340 `(progn (defmacro ,name (category)
341 (list (quote cdr) (list (quote assq)
342 (quote (quote ,prop-name)) category)))
344 (define-setf-method ,name (category)
345 (let* ((--category--temp-- (make-symbol "--category--"))
346 (--value--temp-- (make-symbol "--value--")))
347 (list (list --category--temp--) ; temporary-variables
348 (list category) ; value-forms
349 (list --value--temp--) ; store-variables
350 (let* ((category --category--temp--) ; store-form
351 (value --value--temp--))
352 (list (quote gnus-agent-cat-set-property)
354 (quote (quote ,prop-name))
356 (list (quote ,name) --category--temp--) ; access-form
360 (defmacro gnus-agent-cat-name (category)
363 (gnus-agent-cat-defaccessor
364 gnus-agent-cat-days-until-old agent-days-until-old)
365 (gnus-agent-cat-defaccessor
366 gnus-agent-cat-enable-expiration agent-enable-expiration)
367 (gnus-agent-cat-defaccessor
368 gnus-agent-cat-groups agent-groups)
369 (gnus-agent-cat-defaccessor
370 gnus-agent-cat-high-score agent-high-score)
371 (gnus-agent-cat-defaccessor
372 gnus-agent-cat-length-when-long agent-long-article)
373 (gnus-agent-cat-defaccessor
374 gnus-agent-cat-length-when-short agent-short-article)
375 (gnus-agent-cat-defaccessor
376 gnus-agent-cat-low-score agent-low-score)
377 (gnus-agent-cat-defaccessor
378 gnus-agent-cat-predicate agent-predicate)
379 (gnus-agent-cat-defaccessor
380 gnus-agent-cat-score-file agent-score)
381 (gnus-agent-cat-defaccessor
382 gnus-agent-cat-enable-undownloaded-faces agent-enable-undownloaded-faces)
385 ;; This form is equivalent to defsetf except that it calls make-symbol
386 ;; whereas defsetf calls gensym (Using gensym creates a run-time
387 ;; dependency on the CL library).
390 (define-setf-method gnus-agent-cat-groups (category)
391 (let* ((--category--temp-- (make-symbol "--category--"))
392 (--groups--temp-- (make-symbol "--groups--")))
393 (list (list --category--temp--)
395 (list --groups--temp--)
396 (let* ((category --category--temp--)
397 (groups --groups--temp--))
398 (list (quote gnus-agent-set-cat-groups) category groups))
399 (list (quote gnus-agent-cat-groups) --category--temp--))))
402 (defun gnus-agent-set-cat-groups (category groups)
403 (unless (eq groups 'ignore)
405 (old-g (gnus-agent-cat-groups category)))
406 (cond ((eq new-g old-g)
407 ;; gnus-agent-add-group is fiddling with the group
408 ;; list. Still, Im done.
411 ((eq new-g (cdr old-g))
412 ;; gnus-agent-add-group is fiddling with the group list
413 (setcdr (or (assq 'agent-groups category)
414 (let ((cell (cons 'agent-groups nil)))
415 (setcdr category (cons cell (cdr category)))
418 (let ((groups groups))
420 (let* ((group (pop groups))
421 (old-category (gnus-group-category group)))
422 (if (eq category old-category)
424 (setf (gnus-agent-cat-groups old-category)
425 (delete group (gnus-agent-cat-groups
427 ;; Purge cache as preceeding loop invalidated it.
428 (setq gnus-category-group-cache nil))
430 (setcdr (or (assq 'agent-groups category)
431 (let ((cell (cons 'agent-groups nil)))
432 (setcdr category (cons cell (cdr category)))
435 (defsubst gnus-agent-cat-make (name &optional default-agent-predicate)
436 (list name `(agent-predicate . ,(or default-agent-predicate 'false))))
438 ;;; Fetching setup functions.
440 (defun gnus-agent-start-fetch ()
441 "Initialize data structures for efficient fetching."
442 (gnus-agent-create-buffer))
444 (defun gnus-agent-stop-fetch ()
445 "Save all data structures and clean up."
446 (setq gnus-agent-spam-hashtb nil)
448 (set-buffer nntp-server-buffer)
451 (defmacro gnus-agent-with-fetch (&rest forms)
454 (let ((gnus-agent-fetching t))
455 (gnus-agent-start-fetch)
457 (gnus-agent-stop-fetch)))
459 (put 'gnus-agent-with-fetch 'lisp-indent-function 0)
460 (put 'gnus-agent-with-fetch 'edebug-form-spec '(body))
462 (defmacro gnus-agent-append-to-list (tail value)
463 `(setq ,tail (setcdr ,tail (cons ,value nil))))
465 (defmacro gnus-agent-message (level &rest args)
466 `(if (<= ,level gnus-verbose)
473 (defvar gnus-agent-mode-hook nil
474 "Hook run when installing agent mode.")
476 (defvar gnus-agent-mode nil)
477 (defvar gnus-agent-mode-status '(gnus-agent-mode " Plugged"))
479 (defun gnus-agent-mode ()
480 "Minor mode for providing a agent support in Gnus buffers."
481 (let* ((buffer (progn (string-match "^gnus-\\(.*\\)-mode$"
482 (symbol-name major-mode))
483 (match-string 1 (symbol-name major-mode))))
484 (mode (intern (format "gnus-agent-%s-mode" buffer))))
485 (set (make-local-variable 'gnus-agent-mode) t)
487 (set (make-local-variable mode) t)
489 (when (gnus-visual-p 'agent-menu 'menu)
490 (funcall (intern (format "gnus-agent-%s-make-menu-bar" buffer))))
491 (unless (assq 'gnus-agent-mode minor-mode-alist)
492 (push gnus-agent-mode-status minor-mode-alist))
493 (unless (assq mode minor-mode-map-alist)
494 (push (cons mode (symbol-value (intern (format "gnus-agent-%s-mode-map"
496 minor-mode-map-alist))
497 (when (eq major-mode 'gnus-group-mode)
498 (let ((init-plugged gnus-plugged)
499 (gnus-agent-go-online nil))
500 ;; g-a-t-p does nothing when gnus-plugged isn't changed.
501 ;; Therefore, make certain that the current value does not
502 ;; match the desired initial value.
503 (setq gnus-plugged :unknown)
504 (gnus-agent-toggle-plugged init-plugged)))
505 (gnus-run-hooks 'gnus-agent-mode-hook
506 (intern (format "gnus-agent-%s-mode-hook" buffer)))))
508 (defvar gnus-agent-group-mode-map (make-sparse-keymap))
509 (gnus-define-keys gnus-agent-group-mode-map
510 "Ju" gnus-agent-fetch-groups
511 "Jc" gnus-enter-category-buffer
512 "Jj" gnus-agent-toggle-plugged
513 "Js" gnus-agent-fetch-session
514 "JY" gnus-agent-synchronize-flags
515 "JS" gnus-group-send-queue
516 "Ja" gnus-agent-add-group
517 "Jr" gnus-agent-remove-group
518 "Jo" gnus-agent-toggle-group-plugged)
520 (defun gnus-agent-group-make-menu-bar ()
521 (unless (boundp 'gnus-agent-group-menu)
523 gnus-agent-group-menu gnus-agent-group-mode-map ""
525 ["Toggle plugged" gnus-agent-toggle-plugged t]
526 ["Toggle group plugged" gnus-agent-toggle-group-plugged t]
527 ["List categories" gnus-enter-category-buffer t]
528 ["Add (current) group to category" gnus-agent-add-group t]
529 ["Remove (current) group from category" gnus-agent-remove-group t]
530 ["Send queue" gnus-group-send-queue gnus-plugged]
532 ["All" gnus-agent-fetch-session gnus-plugged]
533 ["Group" gnus-agent-fetch-group gnus-plugged])
534 ["Synchronize flags" gnus-agent-synchronize-flags t]
537 (defvar gnus-agent-summary-mode-map (make-sparse-keymap))
538 (gnus-define-keys gnus-agent-summary-mode-map
539 "Jj" gnus-agent-toggle-plugged
540 "Ju" gnus-agent-summary-fetch-group
541 "JS" gnus-agent-fetch-group
542 "Js" gnus-agent-summary-fetch-series
543 "J#" gnus-agent-mark-article
544 "J\M-#" gnus-agent-unmark-article
545 "@" gnus-agent-toggle-mark
546 "Jc" gnus-agent-catchup)
548 (defun gnus-agent-summary-make-menu-bar ()
549 (unless (boundp 'gnus-agent-summary-menu)
551 gnus-agent-summary-menu gnus-agent-summary-mode-map ""
553 ["Toggle plugged" gnus-agent-toggle-plugged t]
554 ["Mark as downloadable" gnus-agent-mark-article t]
555 ["Unmark as downloadable" gnus-agent-unmark-article t]
556 ["Toggle mark" gnus-agent-toggle-mark t]
557 ["Fetch downloadable" gnus-agent-summary-fetch-group t]
558 ["Catchup undownloaded" gnus-agent-catchup t]))))
560 (defvar gnus-agent-server-mode-map (make-sparse-keymap))
561 (gnus-define-keys gnus-agent-server-mode-map
562 "Jj" gnus-agent-toggle-plugged
563 "Ja" gnus-agent-add-server
564 "Jr" gnus-agent-remove-server)
566 (defun gnus-agent-server-make-menu-bar ()
567 (unless (boundp 'gnus-agent-server-menu)
569 gnus-agent-server-menu gnus-agent-server-mode-map ""
571 ["Toggle plugged" gnus-agent-toggle-plugged t]
572 ["Add" gnus-agent-add-server t]
573 ["Remove" gnus-agent-remove-server t]))))
575 (defun gnus-agent-make-mode-line-string (string mouse-button mouse-func)
576 (if (and (fboundp 'propertize)
577 (fboundp 'make-mode-line-mouse-map))
578 (propertize string 'local-map
579 (make-mode-line-mouse-map mouse-button mouse-func)
580 'mouse-face 'mode-line-highlight)
583 (defun gnus-agent-toggle-plugged (set-to)
584 "Toggle whether Gnus is unplugged or not."
585 (interactive (list (not gnus-plugged)))
586 (cond ((eq set-to gnus-plugged)
589 (setq gnus-plugged set-to)
590 (gnus-run-hooks 'gnus-agent-plugged-hook)
591 (setcar (cdr gnus-agent-mode-status)
592 (gnus-agent-make-mode-line-string " Plugged"
594 'gnus-agent-toggle-plugged))
595 (gnus-agent-go-online gnus-agent-go-online)
596 (gnus-agent-possibly-synchronize-flags))
598 (gnus-agent-close-connections)
599 (setq gnus-plugged set-to)
600 (gnus-run-hooks 'gnus-agent-unplugged-hook)
601 (setcar (cdr gnus-agent-mode-status)
602 (gnus-agent-make-mode-line-string " Unplugged"
604 'gnus-agent-toggle-plugged))))
605 (set-buffer-modified-p t))
607 (defmacro gnus-agent-while-plugged (&rest body)
608 `(let ((original-gnus-plugged gnus-plugged))
610 (progn (gnus-agent-toggle-plugged t)
612 (gnus-agent-toggle-plugged original-gnus-plugged))))
614 (put 'gnus-agent-while-plugged 'lisp-indent-function 0)
615 (put 'gnus-agent-while-plugged 'edebug-form-spec '(body))
617 (defun gnus-agent-close-connections ()
618 "Close all methods covered by the Gnus agent."
619 (let ((methods (gnus-agent-covered-methods)))
621 (gnus-close-server (pop methods)))))
624 (defun gnus-unplugged ()
625 "Start Gnus unplugged."
627 (setq gnus-plugged nil)
631 (defun gnus-plugged ()
632 "Start Gnus plugged."
634 (setq gnus-plugged t)
638 (defun gnus-slave-unplugged (&optional arg)
639 "Read news as a slave unplugged."
641 (setq gnus-plugged nil)
642 (gnus arg nil 'slave))
645 (defun gnus-agentize ()
646 "Allow Gnus to be an offline newsreader.
648 The gnus-agentize function is now called internally by gnus when
649 gnus-agent is set. If you wish to avoid calling gnus-agentize,
650 customize gnus-agent to nil.
652 This will modify the `gnus-setup-news-hook', and
653 `message-send-mail-real-function' variables, and install the Gnus agent
654 minor mode in all Gnus buffers."
657 (add-hook 'gnus-setup-news-hook 'gnus-agent-queue-setup)
658 (unless gnus-agent-send-mail-function
659 (setq gnus-agent-send-mail-function
660 (or message-send-mail-real-function
661 (function (lambda () (funcall message-send-mail-function))))
662 message-send-mail-real-function 'gnus-agent-send-mail))
664 ;; If the servers file doesn't exist, auto-agentize some servers and
665 ;; save the servers file so this auto-agentizing isn't invoked
667 (unless (file-exists-p (nnheader-concat gnus-agent-directory "lib/servers"))
668 (gnus-message 3 "First time agent user, agentizing remote groups...")
670 (lambda (server-or-method)
671 (let ((method (gnus-server-to-method server-or-method)))
672 (when (memq (car method)
673 gnus-agent-auto-agentize-methods)
674 (push (gnus-method-to-server method)
675 gnus-agent-covered-methods)
676 (setq gnus-agent-method-p-cache nil))))
677 (cons gnus-select-method gnus-secondary-select-methods))
678 (gnus-agent-write-servers)))
680 (defun gnus-agent-queue-setup (&optional group-name)
681 "Make sure the queue group exists.
682 Optional arg GROUP-NAME allows to specify another group."
683 (unless (gnus-gethash (format "nndraft:%s" (or group-name "queue"))
685 (gnus-request-create-group (or group-name "queue") '(nndraft ""))
686 (let ((gnus-level-default-subscribed 1))
687 (gnus-subscribe-group (format "nndraft:%s" (or group-name "queue"))
689 (gnus-group-set-parameter
690 (format "nndraft:%s" (or group-name "queue"))
691 'gnus-dummy '((gnus-draft-mode)))))
693 (defun gnus-agent-send-mail ()