;;; nnwarchive.el --- interfacing with web archives
-;; Copyright (C) 1999 Free Software Foundation, Inc.
+
+;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
+;; 2005 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Keywords: news egroups mail-archive
;; 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, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; Note: You need to have `url' (w3 0.46) or greater version
-;; installed for this backend to work.
+;; installed for some functions of this backend to work.
-;; Todo:
+;; Todo:
;; 1. To support more web archives.
;; 2. Generalize webmail to other MHonArc archive.
(require 'gnus-bcklg)
(require 'nnmail)
(require 'mm-util)
-(require 'mail-source)
-(eval-when-compile
- (ignore-errors
- (require 'w3)
- (require 'url)
- (require 'w3-forms)
- (require 'nnweb)))
-;; Report failure to find w3 at load time if appropriate.
-(eval '(progn
- (require 'w3)
- (require 'url)
- (require 'w3-forms)
- (require 'nnweb)))
+(require 'mm-url)
(nnoo-declare nnwarchive)
(defvar nnwarchive-type-definition
'((egroups
(address . "www.egroups.com")
- (open-url
- "http://www.egroups.com/login.cgi?&login_email=%s&login_password=%s"
+ (open-url
+ "http://www.egroups.com/login.cgi?&login_email=%s&login_password=%s"
nnwarchive-login nnwarchive-passwd)
- (list-url
+ (list-url
"http://www.egroups.com/mygroups")
(list-dissect . nnwarchive-egroups-list)
(list-groups . nnwarchive-egroups-list-groups)
- (xover-url
- "http://www.egroups.com/message/%s/%d" group aux)
- (xover-last-url
- "http://www.egroups.com/message/%s/" group)
+ (xover-url
+ "http://www.egroups.com/messages/%s/%d" group aux)
+ (xover-last-url
+ "http://www.egroups.com/messages/%s/" group)
(xover-page-size . 13)
(xover-dissect . nnwarchive-egroups-xover)
- (article-url
+ (article-url
"http://www.egroups.com/message/%s/%d?source=1" group article)
(article-dissect . nnwarchive-egroups-article)
(authentication . t)
(mail-archive
(address . "www.mail-archive.com")
(open-url)
- (list-url
+ (list-url
"http://www.mail-archive.com/lists.html")
(list-dissect . nnwarchive-mail-archive-list)
(list-groups . nnwarchive-mail-archive-list-groups)
- (xover-url
+ (xover-url
"http://www.mail-archive.com/%s/mail%d.html" group aux)
- (xover-last-url
+ (xover-last-url
"http://www.mail-archive.com/%s/maillist.html" group)
(xover-page-size)
(xover-dissect . nnwarchive-mail-archive-xover)
- (article-url
+ (article-url
"http://www.mail-archive.com/%s/msg%05d.html" group article1)
(article-dissect . nnwarchive-mail-archive-article)
(xover-files . nnwarchive-mail-archive-xover-files)
(let ((defs (cdr (assq type nnwarchive-type-definition)))
def)
(dolist (def defs)
- (set (intern (concat "nnwarchive-" (symbol-name (car def))))
+ (set (intern (concat "nnwarchive-" (symbol-name (car def))))
(cdr def)))))
(defmacro nnwarchive-backlog (&rest form)
`(let ((gnus-keep-backlog nnwarchive-keep-backlog)
- (gnus-backlog-buffer
+ (gnus-backlog-buffer
(format " *nnwarchive backlog %s*" nnwarchive-address))
(gnus-backlog-articles nnwarchive-backlog-articles)
(gnus-backlog-hashtb nnwarchive-backlog-hashtb))
(nnwarchive-backlog
(gnus-backlog-enter-article group number buffer)))
-(defun nnwarchive-get-article (article &optional group server buffer)
+(defun nnwarchive-get-article (article &optional group server buffer)
(if (numberp article)
(if (nnwarchive-backlog
- (gnus-backlog-request-article group article
+ (gnus-backlog-request-article group article
(or buffer nntp-server-buffer)))
(cons group article)
(let (contents)
user-mail-address)))
(setq nnwarchive-passwd
(or nnwarchive-passwd
- (mail-source-read-passwd
- (format "Password for %s at %s: "
+ (read-passwd
+ (format "Password for %s at %s: "
nnwarchive-login server)))))
(unless nnwarchive-groups
(nnwarchive-read-groups))
(nnwarchive-open-server server)))
(defun nnwarchive-read-groups ()
- (let ((file (expand-file-name (concat "groups-" nnwarchive-address)
+ (let ((file (expand-file-name (concat "groups-" nnwarchive-address)
nnwarchive-directory)))
(when (file-exists-p file)
(with-temp-buffer
(setq nnwarchive-groups (read (current-buffer)))))))
(defun nnwarchive-write-groups ()
- (with-temp-file (expand-file-name (concat "groups-" nnwarchive-address)
+ (with-temp-file (expand-file-name (concat "groups-" nnwarchive-address)
nnwarchive-directory)
(prin1 nnwarchive-groups (current-buffer))))
(defun nnwarchive-init (server)
"Initialize buffers and such."
(let ((type (intern server)) (defs nnwarchive-type-definition) def)
- (cond
+ (cond
((equal server "")
(setq type nnwarchive-default-type))
((assq type nnwarchive-type-definition) t)
(format " *nnwarchive %s %s*" nnwarchive-type server)))))
(nnwarchive-set-default nnwarchive-type))
-(defun nnwarchive-encode-www-form-urlencoded (pairs)
- "Return PAIRS encoded for forms."
- (mapconcat
- (function