Revision: miles@gnu.org--gnu-2005/gnus--devo--0--patch-151
[gnus] / lisp / nndiary.el
index 29bc343..6852bf4 100644 (file)
@@ -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,7 @@ 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") 
+       (nnmail-cache-insert (nnmail-fetch-field "message-id")
                             group
                             (nnmail-fetch-field "subject")))
       (if (stringp group)
@@ -819,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)
@@ -1213,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)))
 
@@ -1280,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"))
@@ -1314,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)