1 ;;; nnbabyl.el --- rmail mbox access for Gnus
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1099, 2000, 2001, 2002, 2003,
4 ;; 2004, 2005 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
8 ;; Keywords: news, mail
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
29 ;; For an overview of what the interface functions do, please see the
38 5 "Ignore rmail errors from this file, you don't have rmail")))
41 (eval-when-compile (require 'cl))
43 (nnoo-declare nnbabyl)
45 (defvoo nnbabyl-mbox-file (expand-file-name "~/RMAIL")
46 "The name of the rmail box file in the users home directory.")
48 (defvoo nnbabyl-active-file (expand-file-name "~/.rmail-active")
49 "The name of the active file for the rmail box.")
51 (defvoo nnbabyl-get-new-mail t
52 "If non-nil, nnbabyl will check the incoming mail file and split the mail.")
55 (defvoo nnbabyl-prepare-save-mail-hook nil
56 "Hook run narrowed to an article before saving.")
60 (defvar nnbabyl-mail-delimiter "\^_")
62 (defconst nnbabyl-version "nnbabyl 1.0"
65 (defvoo nnbabyl-mbox-buffer nil)
66 (defvoo nnbabyl-current-group nil)
67 (defvoo nnbabyl-status-string "")
68 (defvoo nnbabyl-group-alist nil)
69 (defvoo nnbabyl-active-timestamp nil)
71 (defvoo nnbabyl-previous-buffer-mode nil)
75 ;;; Interface functions
77 (nnoo-define-basics nnbabyl)
79 (deffoo nnbabyl-retrieve-headers (articles &optional group server fetch-old)
81 (set-buffer nntp-server-buffer)
83 (let ((number (length articles))
85 (delim (concat "^" nnbabyl-mail-delimiter))
86 article art-string start stop)
87 (nnbabyl-possibly-change-newsgroup group server)
88 (while (setq article (pop articles))
89 (setq art-string (nnbabyl-article-string article))
90 (set-buffer nnbabyl-mbox-buffer)
92 (when (or (search-forward art-string nil t)
93 (search-backward art-string nil t))