* elmo-nntp.el (elmo-nntp-folder-msgdb-create): Remove accidental
[elisp/wanderlust.git] / elmo / elmo-nntp.el
index ae1d23b..6a05ec0 100644 (file)
@@ -257,7 +257,7 @@ Don't cache if nil.")
    (if (and port
            (null (eq port elmo-nntp-default-port)))
        (concat ":" (if (numberp port)
-                      (int-to-string port) port)))
+                      (number-to-string port) port)))
    (unless (eq (elmo-network-stream-type-symbol type)
               elmo-nntp-default-stream-type)
      (elmo-network-stream-type-spec-string type))))
@@ -454,8 +454,7 @@ Don't cache if nil.")
     (let* ((cache-time (car elmo-nntp-list-folders-cache)))
       (unless (elmo-time-expire cache-time
                                elmo-nntp-list-folders-use-cache)
-       (save-excursion
-         (set-buffer buf)
+       (with-current-buffer buf
          (erase-buffer)
          (insert (nth 3 elmo-nntp-list-folders-cache))
          (goto-char (point-min))
@@ -586,7 +585,7 @@ Don't cache if nil.")
                                "@" (elmo-net-folder-server-internal folder))))
     (unless (eq (elmo-net-folder-port-internal folder) elmo-nntp-default-port)
       (setq append-serv (concat append-serv
-                               ":" (int-to-string
+                               ":" (number-to-string
                                     (elmo-net-folder-port-internal folder)))))
     (unless (eq (elmo-network-stream-type-symbol
                 (elmo-net-folder-stream-type-internal folder))
@@ -603,7 +602,8 @@ Don't cache if nil.")
            ret-val)))
 
 (defun elmo-nntp-make-msglist (beg-str end-str)
-  (elmo-make-number-list (string-to-int beg-str) (string-to-int end-str)))
+  (elmo-make-number-list (string-to-number beg-str)
+                        (string-to-number end-str)))
 
 (luna-define-method elmo-folder-list-messages-plugged ((folder
                                                        elmo-nntp-folder)
@@ -632,7 +632,7 @@ Don't cache if nil.")
               (string-match
                "211 \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\) [^.].+$"
                response)
-              (> (string-to-int (elmo-match-string 1 response)) 0))
+              (> (string-to-number (elmo-match-string 1 response)) 0))
          (setq numbers (elmo-nntp-make-msglist
                         (elmo-match-string 2 response)
                         (elmo-match-string 3 response)))))
@@ -679,9 +679,9 @@ Don't cache if nil.")
                    "211 \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\) [^.].+$"
                    response))
              (progn
-               (setq end-num (string-to-int
+               (setq end-num (string-to-number
                               (elmo-match-string 3 response)))
-               (setq e-num (string-to-int
+               (setq e-num (string-to-number
                             (elmo-match-string 1 response)))
                (when (and killed-list
                           (elmo-number-set-member end-num killed-list))
@@ -716,12 +716,12 @@ Don't cache if nil.")
     (while ov-list
       (setq ov-entity (car ov-list))
 ;;; INN bug??
-;;;   (if (or (> (setq num (string-to-int (aref ov-entity 0)))
+;;;      (if (or (> (setq num (string-to-number (aref ov-entity 0)))
 ;;;             99999)
 ;;;          (<= num 0))
 ;;;      (setq num 0))
-;;;  (setq num (int-to-string num))
-      (setq num (string-to-int (aref ov-entity 0)))
+;;;      (setq num (number-to-string num))
+      (setq num (string-to-number (aref ov-entity 0)))
       (when (or (null numlist)
                (memq num numlist))
        (setq entity (elmo-msgdb-make-message-entity
@@ -740,7 +740,7 @@ Don't cache if nil.")
                                         (aref ov-entity 1)))
                                      elmo-no-subject)
                      :date       (aref ov-entity 3)
-                     :size       (string-to-int (aref ov-entity 6))))
+                     :size       (string-to-number (aref ov-entity 6))))
        (dolist (extra elmo-msgdb-extra-fields)
          (setq extra (downcase extra))
          (when (and (setq field-index
@@ -766,7 +766,7 @@ Don't cache if nil.")
        (session (elmo-nntp-get-session folder))
        (new-msgdb (elmo-make-msgdb))
        beg-num end-num cur length
-       new-msgdb ov-str use-xover dir)
+       ov-str use-xover dir)
     (elmo-nntp-select-group session (elmo-nntp-folder-group-internal
                                     folder))
     (when (setq use-xover (elmo-nntp-xover-p session))
@@ -781,8 +781,8 @@ Don't cache if nil.")
           session
           (format
            "xover %s-%s"
-           (int-to-string cur)
-           (int-to-string
+           (number-to-string cur)
+           (number-to-string
             (+ cur
                elmo-nntp-overview-fetch-chop-length))))
          (with-current-buffer (elmo-network-session-buffer session)
@@ -886,7 +886,7 @@ Don't cache if nil.")
       (goto-char (point-min))
       (while (not (eobp))
        (if (looking-at "^\\([0-9]+\\) \\(.*\\)$")
-           (setq response (cons (cons (string-to-int (elmo-match-buffer 1))
+           (setq response (cons (cons (string-to-number (elmo-match-buffer 1))
                                       (elmo-match-buffer 2))
                                 response)))
        (forward-line 1)))
@@ -912,7 +912,7 @@ Don't cache if nil.")
        (forward-line 1)
        (setq beg (point))
        (setq ret-val (nconc ret-val (list ret-list))))
-;;;   (kill-buffer tmp-buffer)
+;;;      (kill-buffer tmp-buffer)
       ret-val)))
 
 (defun elmo-nntp-get-newsgroup-by-msgid (msgid server user port type)
@@ -980,8 +980,7 @@ Don't cache if nil.")
                   (elmo-get-network-stream-type
                    elmo-nntp-default-stream-type))))
        response has-message-id)
-    (save-excursion
-      (set-buffer content-buf)
+    (with-current-buffer content-buf
       (goto-char (point-min))
       (if (search-forward mail-header-separator nil t)
          (delete-region (match-beginning 0)(match-end 0)))
@@ -999,7 +998,7 @@ Don't cache if nil.")
       (run-hooks 'elmo-nntp-post-pre-hook)
       (elmo-nntp-send-buffer session content-buf)
       (elmo-nntp-send-command session ".")
-;;;   (elmo-nntp-read-response buffer process t)
+;;;      (elmo-nntp-read-response buffer process t)
       (if (not (string-match
                "^2" (setq response (elmo-nntp-read-raw-response
                                     session))))
@@ -1074,14 +1073,14 @@ Returns a list of cons cells like (NUMBER . VALUE)"
      ((string= "last" search-key)
       (let ((numbers (or from-msgs (elmo-folder-list-messages spec))))
        (nthcdr (max (- (length numbers)
-                       (string-to-int (elmo-filter-value condition)))
+                       (string-to-number (elmo-filter-value condition)))
                     0)
                numbers)))
      ((string= "first" search-key)
       (let* ((numbers (or from-msgs (elmo-folder-list-messages spec)))
-            (rest (nthcdr (string-to-int (elmo-filter-value condition) )
+            (rest (nthcdr (string-to-number (elmo-filter-value condition) )
                           numbers)))
-       (mapcar '(lambda (x) (delete x numbers)) rest)
+       (mapc (lambda (x) (delete x numbers)) rest)
        numbers))
      ((or (string= "since" search-key)
          (string= "before" search-key))
@@ -1353,7 +1352,7 @@ Returns a list of cons cells like (NUMBER . VALUE)"
          (setq beg (save-excursion (forward-line 1) (point)))
          (setq num
                (and (looking-at "^2[0-9]*[ ]+\\([0-9]+\\)")
-                    (string-to-int
+                    (string-to-number
                      (elmo-match-buffer 1))))
          (elmo-nntp-next-result-arrived-p)
          (when num