This commit was generated by cvs2svn to compensate for changes in r2264,
[elisp/gnus.git-] / lisp / nnspool.el
index dd3d89c..6914f78 100644 (file)
@@ -28,6 +28,7 @@
 
 (require 'nnheader)
 (require 'nntp)
+(require 'timezone)
 (require 'nnoo)
 (eval-when-compile (require 'cl))
 
@@ -279,7 +280,7 @@ there.")
        (while (and (not (looking-at
                          "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] "))
                    (zerop (forward-line -1))))
-       (let ((seconds (time-to-seconds (date-to-time date)))
+       (let ((seconds (nnspool-seconds-since-epoch date))
              groups)
          ;; Go through lines and add the latest groups to a list.
          (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ")
@@ -419,6 +420,7 @@ 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))
@@ -451,6 +453,18 @@ 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