summaryrefslogtreecommitdiff
path: root/lisp/gnus/nnspool.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-09-19 13:37:09 +0000
committerGerd Moellmann <gerd@gnu.org>2000-09-19 13:37:09 +0000
commit16409b0bb832ae376894cbad5892bf7623caeaaf (patch)
tree7a795d31e621510c8720e8956f248cc758dc2058 /lisp/gnus/nnspool.el
parentce9ded5de26ead5cc69bd9179662c2d6600f7500 (diff)
downloademacs-16409b0bb832ae376894cbad5892bf7623caeaaf.tar.gz
Update to emacs-21-branch of the Gnus CVS repository.
Diffstat (limited to 'lisp/gnus/nnspool.el')
-rw-r--r--lisp/gnus/nnspool.el45
1 files changed, 17 insertions, 28 deletions
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el
index da39914f5d4..b33a2dbb50e 100644
--- a/lisp/gnus/nnspool.el
+++ b/lisp/gnus/nnspool.el
@@ -1,5 +1,7 @@
;;; nnspool.el --- spool access for GNU Emacs
-;; Copyright (C) 1988,89,90,93,94,95,96,97,98 Free Software Foundation, Inc.
+
+;; Copyright (C) 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997, 1998,
+;; 2000 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -28,7 +30,6 @@
(require 'nnheader)
(require 'nntp)
-(require 'timezone)
(require 'nnoo)
(eval-when-compile (require 'cl))
@@ -85,10 +86,6 @@ there.")
(defvoo nnspool-file-coding-system nnheader-file-coding-system
"Coding system for nnspool.")
-;; 1997/8/14 by MORIOKA Tomohiko
-(defvoo nnspool-file-coding-system nnheader-file-coding-system
- "Coding system for nnspool.")
-
(defconst nnspool-version "nnspool 2.0"
@@ -141,15 +138,20 @@ there.")
(setq beg (point))
(inline (nnheader-insert-head file))
(goto-char beg)
- (search-forward "\n\n" nil t)
- (forward-char -1)
- (insert ".\n")
+ (if (search-forward "\n\n" nil t)
+ (progn
+ (forward-char -1)
+ (insert ".\n"))
+ (goto-char (point-max))
+ (if (bolp)
+ (insert ".\n")
+ (insert "\n.\n")))
(delete-region (point) (point-max)))
(and do-message
(zerop (% (incf count) 20))
(nnheader-message 5 "nnspool: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (/ (* count 100) number))))
(when do-message
(nnheader-message 5 "nnspool: Receiving headers...done"))
@@ -284,7 +286,7 @@ there.")
(while (and (not (looking-at
"\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] "))
(zerop (forward-line -1))))
- (let ((seconds (nnspool-seconds-since-epoch date))
+ (let ((seconds (time-to-seconds (date-to-time date)))
groups)
;; Go through lines and add the latest groups to a list.
(while (and (looking-at "\\([^ ]+\\) +[0-9]+ ")
@@ -299,8 +301,8 @@ there.")
(read (current-buffer)))
seconds))
(push (buffer-substring
- (match-beginning 1) (match-end 1))
- groups)
+ (match-beginning 1) (match-end 1))
+ groups)
(zerop (forward-line -1))))
(erase-buffer)
(while groups
@@ -424,7 +426,6 @@ there.")
(defun nnspool-find-id (id)
(save-excursion
(set-buffer (get-buffer-create " *nnspool work*"))
- (buffer-disable-undo (current-buffer))
(erase-buffer)
(ignore-errors
(call-process "grep" nil t nil (regexp-quote id) nnspool-history-file))
@@ -439,8 +440,8 @@ there.")
(set-buffer nntp-server-buffer)
(erase-buffer)
(condition-case ()
- (let ((nnheader-file-coding-system nnspool-file-coding-system))
- (nnheader-insert-file-contents file)
+ (let ((coding-system-for-read nnspool-file-coding-system))
+ (mm-insert-file-contents file)
t)
(file-error nil)))
@@ -457,18 +458,6 @@ there.")
"Find the path for GROUP."
(nnheader-group-pathname group nnspool-spool-directory article))
-(defun nnspool-seconds-since-epoch (date)
- (let* ((tdate (mapcar (lambda (ti) (and ti (string-to-int ti)))
- (timezone-parse-date date)))
- (ttime (mapcar (lambda (ti) (and ti (string-to-int ti)))
- (timezone-parse-time
- (aref (timezone-parse-date date) 3))))
- (unix (encode-time (nth 2 ttime) (nth 1 ttime) (nth 0 ttime)
- (nth 2 tdate) (nth 1 tdate) (nth 0 tdate)
- (nth 4 tdate))))
- (+ (* (car unix) 65536.0)
- (cadr unix))))
-
(provide 'nnspool)
;;; nnspool.el ends here