Revision: miles@gnu.org--gnu-2005/gnus--devo--0--patch-151
[gnus] / lisp / nndiary.el
index cec8ee4..6852bf4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nndiary.el --- A diary backend for Gnus
 
-;; Copyright (C) 1999, 2000, 2001
+;; Copyright (C) 1999, 2000, 2001, 2003
 ;;        Free Software Foundation, Inc.
 
 ;; Author:        Didier Verna <didier@xemacs.org>
@@ -22,7 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+;; MA 02110-1301, USA.
 
 
 ;;; Commentary:
 
 (defgroup nndiary nil
   "The Gnus Diary backend."
+  :version "22.1"
   :group 'gnus-diary)
 
 (defcustom nndiary-mail-sources
@@ -600,7 +602,7 @@ all.  This may very well take some time.")
       (nnheader-report 'nndiary "Article %s retrieved" id)
       ;; We return the article number.
       (cons (if group-num (car group-num) group)
-           (string-to-int (file-name-nondirectory path)))))))
+           (string-to-number (file-name-nondirectory path)))))))
 
 (deffoo nndiary-request-group (group &optional server dont-check)
   (let ((file-name-coding-system nnmail-pathname-coding-system))
@@ -723,7 +725,7 @@ all.  This may very well take some time.")
     (nconc rest articles)))
 
 (deffoo nndiary-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   (let ((buf (get-buffer-create " *nndiary move*"))
        result)
     (nndiary-possibly-change-directory group server)
@@ -759,7 +761,9 @@ all.  This may very well take some time.")
   (when (nndiary-schedule)
     (let (result)
       (when nnmail-cache-accepted-message-ids
-       (nnmail-cache-insert (nnmail-fetch-field "message-id") group))
+       (nnmail-cache-insert (nnmail-fetch-field "message-id")
+                            group
+                            (nnmail-fetch-field "subject")))
       (if (stringp group)
          (and
           (nnmail-activate 'nndiary)
@@ -817,7 +821,7 @@ all.  This may very well take some time.")
            ;; we should insert it.  (This situation should never
            ;; occur, but one likes to make sure...)
            (while (and (looking-at "[0-9]+\t")
-                       (< (string-to-int
+                       (< (string-to-number
                            (buffer-substring
                             (match-beginning 0) (match-end 0)))
                           article)
@@ -990,7 +994,7 @@ all.  This may very well take some time.")
                  (search-forward id nil t)) ; We find the ID.
        ;; And the id is in the fourth field.
        (if (not (and (search-backward "\t" nil t 4)
-                     (not (search-backward"\t" (gnus-point-at-bol) t))))
+                     (not (search-backward"\t" (point-at-bol) t))))
            (forward-line 1)
          (beginning-of-line)
          (setq found t)
@@ -1211,9 +1215,7 @@ all.  This may very well take some time.")
     (push (list group
                (cons (or (caar files) (1+ last))
                      (max last
-                          (or (let ((f files))
-                                (while (cdr f) (setq f (cdr f)))
-                                (caar f))
+                          (or (caar (last files))
                               0))))
          nndiary-group-alist)))
 
@@ -1278,14 +1280,14 @@ all.  This may very well take some time.")
          (nnheader-article-to-file-alist nndiary-current-directory))))
 
 
-(defun nndiary-string-to-int (str min &optional max)
-  ;; Like `string-to-int' but barf if STR is not exactly an integer, and not
+(defun nndiary-string-to-number (str min &optional max)
+  ;; Like `string-to-number' but barf if STR is not exactly an integer, and not
   ;; within the specified bounds.
   ;; Signals are caught by `nndiary-schedule'.
   (if (not (string-match "^[ \t]*[0-9]+[ \t]*$" str))
       (nndiary-error "not an integer value")
     ;; else
-    (let ((val (string-to-int str)))
+    (let ((val (string-to-number str)))
       (and (or (< val min)
               (and max (> val max)))
           (nndiary-error "value out of range"))
@@ -1312,12 +1314,12 @@ all.  This may very well take some time.")
         (let ((res (split-string val "-")))
           (cond
            ((= (length res) 1)
-            (nndiary-string-to-int (car res) min-or-values max))
+            (nndiary-string-to-number (car res) min-or-values max))
            ((= (length res) 2)
             ;; don't know if crontab accepts this, but ensure
             ;; that BEG is <= END
-            (let ((beg (nndiary-string-to-int (car res) min-or-values max))
-                  (end (nndiary-string-to-int (cadr res) min-or-values max)))
+            (let ((beg (nndiary-string-to-number (car res) min-or-values max))
+                  (end (nndiary-string-to-number (cadr res) min-or-values max)))
               (cond ((< beg end)
                      (cons beg end))
                     ((= beg end)
@@ -1706,4 +1708,5 @@ all.  This may very well take some time.")
 (provide 'nndiary)
 
 
+;;; arch-tag: 9c542b95-92e7-4ace-a038-330ab296e203
 ;;; nndiary.el ends here