From: kaoru Date: Sun, 17 Feb 2008 10:18:54 +0000 (+0000) Subject: Use `string-to-number' instead of `string-to-int'. X-Git-Tag: wl-2_15_6-fixes~41 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0d2e104ccdb5ee1c8fa06b722bf9fe7b3aa36d2;p=elisp%2Fwanderlust.git Use `string-to-number' instead of `string-to-int'. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 0148bfc..aecde50 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,44 @@ +2008-02-17 TAKAHASHI Kaoru + + * modb.el (elmo-msgdb-match-condition-primitive): Use + `string-to-number' instead of `string-to-int'. + + * modb-entity.el (elmo-msgdb-create-message-entity-from-buffer) + (elmo-msgdb-message-match-condition) + (elmo-msgdb-create-message-entity-from-buffer): Use + `string-to-number' instead of `string-to-int'. + + * elmo.el (elmo-folder-confirm-appends): Use `string-to-number' + instead of `string-to-int'. + + * elmo-util.el (elmo-cache-expire-by-age): Use `string-to-number' + instead of `string-to-int'. + + * elmo-pop3.el (elmo-pop3-list-by-list, elmo-folder-status): Use + `string-to-number' instead of `string-to-int'. + + * elmo-nntp.el (elmo-nntp-make-msglist) + (elmo-folder-list-messages-plugged, elmo-nntp-folder-status) + (elmo-nntp-create-msgdb-from-overview-string) + (elmo-nntp-parse-xhdr-response, elmo-nntp-msgdb-create-message) + (elmo-nntp-search-primitive): Use `string-to-number' instead of + `string-to-int'. + + * elmo-net.el (elmo-net-folder-set-parameters): Use + `string-to-number' instead of `string-to-int'. + + * elmo-localdir.el (elmo-localdir-list-subr): Use + `string-to-number' instead of `string-to-int'. + + * elmo-imap4.el (elmo-imap4-search-internal-primitive): Use + `string-to-number' instead of `string-to-int'. + + * elmo-date.el (elmo-date-get-datevec): Use `string-to-number' + instead of `string-to-int'. + + * elmo-archive.el (elmo-archive-list-folder-subr): Use + `string-to-number' instead of `string-to-int'. + 2008-02-16 TAKAHASHI Kaoru * elmo-util.el (elmo-get-passwd): Fix typo. diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index 6abaf2a..31b7c70 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -303,7 +303,7 @@ TYPE specifies the archiver's symbol." (goto-char (point-min)))) (while (and (re-search-forward file-regexp nil t) (not (eobp))) ; for GNU tar 981010 - (setq file-list (nconc file-list (list (string-to-int + (setq file-list (nconc file-list (list (string-to-number (match-string 1))))))) (error "%s does not exist" file)) (if nonsort diff --git a/elmo/elmo-date.el b/elmo/elmo-date.el index b2dfb65..e2a05af 100644 --- a/elmo/elmo-date.el +++ b/elmo/elmo-date.el @@ -115,7 +115,7 @@ Otherwise treat \\ in NEWTEXT string as special: (timezone-fix-time (current-time-string) (current-time-zone) nil))) (number - (string-to-int + (string-to-number (if (match-beginning 1) (elmo-match-string 1 description) "0"))) diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 91522d0..ca2b4ab 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -2225,12 +2225,12 @@ If optional argument REMOVE is non-nil, remove FLAG." ((string= "last" search-key) (let ((numbers (or from-msgs (elmo-folder-list-messages folder)))) (nthcdr (max (- (length numbers) - (string-to-int (elmo-filter-value filter))) + (string-to-number (elmo-filter-value filter))) 0) numbers))) ((string= "first" search-key) (let* ((numbers (or from-msgs (elmo-folder-list-messages folder))) - (rest (nthcdr (string-to-int (elmo-filter-value filter) ) + (rest (nthcdr (string-to-number (elmo-filter-value filter) ) numbers))) (mapcar '(lambda (x) (delete x numbers)) rest) numbers)) diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 723a219..935762d 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -177,7 +177,7 @@ one-level))) (defsubst elmo-localdir-list-subr (folder &optional nonsort) - (let ((flist (mapcar 'string-to-int + (let ((flist (mapcar 'string-to-number (directory-files (elmo-localdir-folder-directory-internal folder) nil "^[0-9]+$" t))) diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index df30cb1..67e3970 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -351,7 +351,7 @@ Returned value is searched from `elmo-network-stream-type-alist'." ;; port (elmo-net-folder-set-port-internal folder - (or (and port (string-to-int port)) + (or (and port (string-to-number port)) (plist-get defaults :port))) ;; stream-type (elmo-net-folder-set-stream-type-internal diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index ae1d23b..f297f95 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -603,7 +603,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 +633,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 +680,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)) @@ -721,7 +722,7 @@ Don't cache if nil.") ;;; (<= num 0)) ;;; (setq num 0)) ;;; (setq num (int-to-string num)) - (setq num (string-to-int (aref ov-entity 0))) + (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 +741,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 @@ -886,7 +887,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))) @@ -1074,12 +1075,12 @@ 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) numbers)) @@ -1353,7 +1354,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 diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index c95188d..b59f95b 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -582,7 +582,7 @@ until the login delay period has expired")) (if elmo-pop3-list-done (progn (mapatoms (lambda (atom) - (setq list (cons (string-to-int + (setq list (cons (string-to-number (substring (symbol-name atom) 1)) list))) elmo-pop3-size-hash) @@ -617,7 +617,7 @@ until the login delay period has expired")) (if (not (string-match "^\+OK[ \t]*\\([0-9]*\\)" response)) (error "POP STAT command failed") (setq total - (string-to-int + (string-to-number (substring response (match-beginning 1)(match-end 1 )))) (elmo-folder-close-internal folder) (cons total total)))))) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 87e9eaa..2e7c597 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -2117,7 +2117,7 @@ Optional argument DAYS specifies the days to expire caches." curtime) (if (string= age "") (setq age elmo-cache-expire-default-age) - (setq age (string-to-int age))) + (setq age (string-to-number age))) (setq curtime (current-time)) (setq curtime (+ (* (nth 0 curtime) (float 65536)) (nth 1 curtime))) diff --git a/elmo/elmo.el b/elmo/elmo.el index d07638d..ed890eb 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1498,7 +1498,7 @@ If Optional LOCAL is non-nil, don't update server flag." (while t (setq in (read-from-minibuffer "Update number: " (int-to-string in)) - in (string-to-int in)) + in (string-to-number in)) (if (< len in) (throw 'end len)) (if (y-or-n-p (format diff --git a/elmo/modb-entity.el b/elmo/modb-entity.el index 05e6cdc..77d53ce 100644 --- a/elmo/modb-entity.el +++ b/elmo/modb-entity.el @@ -483,7 +483,7 @@ If each field is t, function is set as default converter." cc (mapconcat 'identity (elmo-multiple-field-body "cc") ",")) (unless (elmo-msgdb-message-entity-field handler entity 'size) (if (setq size (elmo-field-body "content-length")) - (setq size (string-to-int size)) + (setq size (string-to-number size)) (setq size 0))) (while extras (if (setq field-body (elmo-field-body (car extras))) @@ -561,7 +561,7 @@ If each field is t, function is set as default converter." ((or (string= key "larger") (string= key "smaller")) (let ((bytes (elmo-msgdb-message-entity-field handler entity 'size)) - (threshold (string-to-int (elmo-filter-value condition)))) + (threshold (string-to-number (elmo-filter-value condition)))) (if (string= key "larger") (> bytes threshold) (< bytes threshold)))) @@ -765,7 +765,7 @@ If each field is t, function is set as default converter." :size (let ((size (elmo-field-body "content-length"))) (if size - (string-to-int size) + (string-to-number size) (or (plist-get args :size) 0))))))) (let (field-name field-body extractor) (dolist (extra (cons "newsgroups" elmo-msgdb-extra-fields)) diff --git a/elmo/modb.el b/elmo/modb.el index c02b7f4..6574e63 100644 --- a/elmo/modb.el +++ b/elmo/modb.el @@ -233,11 +233,11 @@ If optional argument TYPE is specified, return converted value.") (cond ((string= key "last") (<= (length (memq number population)) - (string-to-int (elmo-filter-value condition)))) + (string-to-number (elmo-filter-value condition)))) ((string= key "first") (< (- (length population) (length (memq number population))) - (string-to-int (elmo-filter-value condition)))) + (string-to-number (elmo-filter-value condition)))) ((string= key "flag") (let ((flags (elmo-msgdb-flags msgdb number))) (cond ((string= (elmo-filter-value condition) "any")