-;;; nneething.el --- random file access for Gnus
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;;; nneething.el --- arbitrary file access for Gnus
-;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
-;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Keywords: news, mail
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
-;; Based on nnspool.el by Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>.
-;; For an overview of what the interface functions do, please see the
-;; Gnus sources.
-
;;; Code:
+(eval-when-compile (require 'cl))
+
+(require 'mailcap)
(require 'nnheader)
(require 'nnmail)
+(require 'nnoo)
+(require 'gnus-util)
+
+(nnoo-declare nneething)
-(defvar nneething-map-file-directory "~/.nneething/"
- "*Map files directory.")
+(defvoo nneething-map-file-directory
+ (nnheader-concat gnus-directory ".nneething/")
+ "Where nneething stores the map files.")
-(defvar nneething-exclude-files "~$"
- "*Regexp saying what files to exclude from the group.")
+(defvoo nneething-map-file ".nneething"
+ "Name of the map files.")
-(defvar nneething-map-file ".nneething"
- "*Name of map files.")
+(defvoo nneething-exclude-files nil
+ "Regexp saying what files to exclude from the group.
+If this variable is nil, no files will be excluded.")
+
+(defvoo nneething-include-files nil
+ "Regexp saying what files to include in the group.
+If this variable is non-nil, only files matching this regexp will be
+included.")
\f
-(defconst nneething-version "nneething 0.1"
+;;; Internal variables.
+
+(defconst nneething-version "nneething 1.0"
"nneething version.")
-(defvar nneething-current-directory nil
+(defvoo nneething-current-directory nil
"Current news group directory.")
-(defvar nneething-status-string "")
-(defvar nneething-group-alist nil)
+(defvoo nneething-status-string "")
-\f
+(defvoo nneething-work-buffer " *nneething work*")
-(defvar nneething-directory nil)
-(defvar nneething-group nil)
-(defvar nneething-map nil)
-(defvar nneething-read-only nil)
-(defvar nneething-active nil)
-(defvar nneething-server-variables
- (list
- (list 'nneething-directory nneething-directory)
- '(nneething-current-directory nil)
- '(nneething-status-string "")
- '(nneething-group-alist)))
+(defvoo nneething-group nil)
+(defvoo nneething-map nil)
+(defvoo nneething-read-only nil)
+(defvoo nneething-active nil)
+(defvoo nneething-address nil)
\f
;;; Interface functions.
-(defun nneething-retrieve-headers (sequence &optional newsgroup server)
- (nneething-possibly-change-directory newsgroup)
+(nnoo-define-basics nneething)
- (save-excursion
- (set-buffer nntp-server-buffer)
+(deffoo nneething-retrieve-headers (articles &optional group server fetch-old)
+ (nneething-possibly-change-directory group)
+
+ (with-current-buffer nntp-server-buffer
(erase-buffer)
- (let* ((number (length sequence))
+ (let* ((number (length articles))
(count 0)
(large (and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)))
- beg article file)
+ article file)
- (if (stringp (car sequence))
+ (if (stringp (car articles))
'headers
- (while sequence
- (setq article (car sequence))
+ (while (setq article (pop articles))
(setq file (nneething-file-name article))
- (if (and (file-exists-p file)
- &nbs