From b09a5bb4fbe14ae9769670d1131ab3b204dda4c9 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Mon, 30 May 2005 14:45:12 +0000 Subject: [PATCH] * encrypt.el (encrypt-xor-process-buffer): Replace `string-to-int' by `string-to-number'. * gnus-agent.el (gnus-agent-regenerate-group) (gnus-agent-fetch-articles): Ditto. * gnus-art.el (gnus-button-fetch-group): Ditto. * gnus-cache.el (gnus-cache-generate-active) (gnus-cache-articles-in-group): Ditto. * gnus-group.el (gnus-group-set-current-level) (gnus-group-insert-group-line): Ditto. * gnus-score.el (gnus-score-set-expunge-below) (gnus-score-set-mark-below, gnus-summary-score-effect) (gnus-summary-score-entry): Ditto. * gnus-soup.el (gnus-soup-send-packet, gnus-soup-parse-areas) (gnus-soup-pack): Ditto. * gnus-spec.el (gnus-xmas-format): Ditto. * gnus-start.el (gnus-newsrc-to-gnus-format): Ditto. * gnus-sum.el (gnus-create-xref-hashtb): Ditto. * gnus-uu.el (gnus-uu-expand-numbers): Ditto. * nnbabyl.el (nnbabyl-article-group-number): Ditto. * nndb.el (nndb-get-remote-expire-response): Ditto. * nndiary.el (nndiary-parse-schedule-value) (nndiary-string-to-number, nndiary-request-replace-article) (nndiary-request-article): Ditto. * nndoc.el (nndoc-rnews-body-end, nndoc-mbox-body-end): Ditto. * nndraft.el (nndraft-articles, nndraft-request-group): Ditto. * nneething.el (nneething-make-head): Ditto. * nnfolder.el (nnfolder-request-article) (nnfolder-retrieve-headers): Ditto. * nnheader.el (nnheader-file-to-number): Ditto. * nnkiboze.el (nnkiboze-request-article): Ditto. * nnmail.el (nnmail-process-unix-mail-format) (nnmail-process-babyl-mail-format): Ditto. * nnmbox.el (nnmbox-read-mbox, nnmbox-article-group-number): Ditto. * nnmh.el (nnmh-update-gnus-unreads, nnmh-active-number) (nnmh-request-create-group, nnmh-request-list-1) (nnmh-request-group, nnmh-request-article): Ditto. * nnml.el (nnml-request-replace-article, nnml-request-article): Ditto. * nnrss.el (nnrss-find-rss-via-syndic8): Ditto. * nnsoup.el (nnsoup-make-active): Ditto. * nnspool.el (nnspool-find-id, nnspool-request-group): Ditto. * nntp.el (nntp-find-group-and-number) (nntp-retrieve-headers-with-xover): Ditto. * pgg-gpg.el (pgg-gpg-snarf-keys-region): Ditto. * pgg-parse.el (pgg-read-body, pgg-read-bytes) (pgg-format-key-identifier): Ditto. * pop3.el (pop3-last, pop3-stat): Ditto. * qp.el (quoted-printable-decode-region): Ditto. --- lisp/ChangeLog | 48 ++++++++++++++++++++++++++++++++++++++++++++++ lisp/encrypt.el | 2 +- lisp/gnus-agent.el | 4 ++-- lisp/gnus-art.el | 2 +- lisp/gnus-cache.el | 4 ++-- lisp/gnus-group.el | 4 ++-- lisp/gnus-score.el | 8 ++++---- lisp/gnus-soup.el | 8 ++++---- lisp/gnus-spec.el | 2 +- lisp/gnus-start.el | 2 +- lisp/gnus-sum.el | 2 +- lisp/gnus-uu.el | 2 +- lisp/nnbabyl.el | 2 +- lisp/nndb.el | 2 +- lisp/nndiary.el | 16 ++++++++-------- lisp/nndoc.el | 4 ++-- lisp/nndraft.el | 4 ++-- lisp/nneething.el | 2 +- lisp/nnfolder.el | 6 +++--- lisp/nnheader.el | 4 ++-- lisp/nnkiboze.el | 2 +- lisp/nnmail.el | 4 ++-- lisp/nnmbox.el | 4 ++-- lisp/nnmh.el | 12 ++++++------ lisp/nnml.el | 4 ++-- lisp/nnrss.el | 2 +- lisp/nnsoup.el | 4 ++-- lisp/nnspool.el | 4 ++-- lisp/nntp.el | 6 +++--- lisp/pgg-gpg.el | 2 +- lisp/pgg-parse.el | 6 +++--- lisp/pop3.el | 6 +++--- lisp/qp.el | 2 +- 33 files changed, 117 insertions(+), 69 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 44c69f9f5..424786760 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,53 @@ 2005-05-30 Reiner Steib + * encrypt.el (encrypt-xor-process-buffer): Replace `string-to-int' + by `string-to-number'. + * gnus-agent.el (gnus-agent-regenerate-group) + (gnus-agent-fetch-articles): Ditto. + * gnus-art.el (gnus-button-fetch-group): Ditto. + * gnus-cache.el (gnus-cache-generate-active) + (gnus-cache-articles-in-group): Ditto. + * gnus-group.el (gnus-group-set-current-level) + (gnus-group-insert-group-line): Ditto. + * gnus-score.el (gnus-score-set-expunge-below) + (gnus-score-set-mark-below, gnus-summary-score-effect) + (gnus-summary-score-entry): Ditto. + * gnus-soup.el (gnus-soup-send-packet, gnus-soup-parse-areas) + (gnus-soup-pack): Ditto. + * gnus-spec.el (gnus-xmas-format): Ditto. + * gnus-start.el (gnus-newsrc-to-gnus-format): Ditto. + * gnus-sum.el (gnus-create-xref-hashtb): Ditto. + * gnus-uu.el (gnus-uu-expand-numbers): Ditto. + * nnbabyl.el (nnbabyl-article-group-number): Ditto. + * nndb.el (nndb-get-remote-expire-response): Ditto. + * nndiary.el (nndiary-parse-schedule-value) + (nndiary-string-to-number, nndiary-request-replace-article) + (nndiary-request-article): Ditto. + * nndoc.el (nndoc-rnews-body-end, nndoc-mbox-body-end): Ditto. + * nndraft.el (nndraft-articles, nndraft-request-group): Ditto. + * nneething.el (nneething-make-head): Ditto. + * nnfolder.el (nnfolder-request-article) + (nnfolder-retrieve-headers): Ditto. + * nnheader.el (nnheader-file-to-number): Ditto. + * nnkiboze.el (nnkiboze-request-article): Ditto. + * nnmail.el (nnmail-process-unix-mail-format) + (nnmail-process-babyl-mail-format): Ditto. + * nnmbox.el (nnmbox-read-mbox, nnmbox-article-group-number): Ditto. + * nnmh.el (nnmh-update-gnus-unreads, nnmh-active-number) + (nnmh-request-create-group, nnmh-request-list-1) + (nnmh-request-group, nnmh-request-article): Ditto. + * nnml.el (nnml-request-replace-article, nnml-request-article): Ditto. + * nnrss.el (nnrss-find-rss-via-syndic8): Ditto. + * nnsoup.el (nnsoup-make-active): Ditto. + * nnspool.el (nnspool-find-id, nnspool-request-group): Ditto. + * nntp.el (nntp-find-group-and-number) + (nntp-retrieve-headers-with-xover): Ditto. + * pgg-gpg.el (pgg-gpg-snarf-keys-region): Ditto. + * pgg-parse.el (pgg-read-body, pgg-read-bytes) + (pgg-format-key-identifier): Ditto. + * pop3.el (pop3-last, pop3-stat): Ditto. + * qp.el (quoted-printable-decode-region): Ditto. + * spam-report.el (spam-report-url-ping-mm-url): Use format instead of concat. diff --git a/lisp/encrypt.el b/lisp/encrypt.el index 8127158f1..8d5a21fc2 100644 --- a/lisp/encrypt.el +++ b/lisp/encrypt.el @@ -213,7 +213,7 @@ Format example: (progn (setq new-list (reverse (split-string bs))) (dolist (x new-list) - (setq x (string-to-int x)) + (setq x (string-to-number x)) (insert (format "%c" (logxor x passphrase-sum)))))) (buffer-substring-no-properties (point-min) (point-max))))) diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 4226570bd..979f61a4f 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -1562,7 +1562,7 @@ downloaded into the agent." (while (looking-at "\\([^: \n]+\\):\\([0-9]+\\) *") (push (cons (buffer-substring (match-beginning 1) (match-end 1)) - (string-to-int + (string-to-number (buffer-substring (match-beginning 2) (match-end 2)))) crosses) @@ -3775,7 +3775,7 @@ If REREAD is not nil, downloaded articles are marked as unread." (dir (file-name-directory file)) point (downloaded (if (file-exists-p dir) - (sort (mapcar (lambda (name) (string-to-int name)) + (sort (mapcar (lambda (name) (string-to-number name)) (directory-files dir nil "^[0-9]+$" t)) '>) (progn (gnus-make-directory dir) nil))) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 26b2efb8c..b622859e9 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -6764,7 +6764,7 @@ specified by `gnus-button-alist'." (match-string 3 address) "nntp"))) nil nil nil - (and (match-end 6) (list (string-to-int (match-string 6 address)))))))) + (and (match-end 6) (list (string-to-number (match-string 6 address)))))))) (defun gnus-url-parse-query-string (query &optional downcase) (let (retval pairs cur key val) diff --git a/lisp/gnus-cache.el b/lisp/gnus-cache.el index f54236a40..e347135e2 100644 --- a/lisp/gnus-cache.el +++ b/lisp/gnus-cache.el @@ -490,7 +490,7 @@ Returns the list of articles removed." articles) (when (file-exists-p dir) (setq articles - (sort (mapcar (lambda (name) (string-to-int name)) + (sort (mapcar (lambda (name) (string-to-number name)) (directory-files dir nil "^[0-9]+$" t)) '<)) ;; Update the cache active file, just to synch more. @@ -682,7 +682,7 @@ If LOW, update the lower bound instead." ;; Separate articles from all other files and directories. (while files (if (string-match "^[0-9]+$" (file-name-nondirectory (car files))) - (push (string-to-int (file-name-nondirectory (pop files))) nums) + (push (string-to-number (file-name-nondirectory (pop files))) nums) (push (pop files) alphs))) ;; If we have nums, then this is probably a valid group. (when (setq nums (sort nums '<)) diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index db865ed20..4eb11111d 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1466,7 +1466,7 @@ if it is a string, only list groups matching REGEXP." (eval gnus-group-line-format-spec))) `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb) gnus-unread ,(if (numberp number) - (string-to-int gnus-tmp-number-of-unread) + (string-to-number gnus-tmp-number-of-unread) t) gnus-marked ,gnus-tmp-marked-mark gnus-indentation ,gnus-group-indentation @@ -3288,7 +3288,7 @@ Uses the process/prefix convention." (progn (unless (gnus-group-process-prefix current-prefix-arg) (error "No group on the current line")) - (string-to-int + (string-to-number (let ((s (read-string (format "Level (default %s): " (or (gnus-group-group-level) diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index 5c3d74aad..1ba911af2 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -837,7 +837,7 @@ If optional argument `EXTRA' is non-nil, it's a non-standard overview header." ;; If this is an integer comparison, we transform from string to int. (if (eq (nth 2 (assoc header gnus-header-index)) 'gnus-score-integer) (if (stringp match) - (setq match (string-to-int match))) + (setq match (string-to-number match))) (set-text-properties 0 (length match) nil match)) (unless (eq date 'now) @@ -902,7 +902,7 @@ EXTRA is the possible non-standard header." t) (read-string "Match: ") (if (y-or-n-p "Use regexp match? ") 'r 's) - (string-to-int (read-string "Score: ")))) + (string-to-number (read-string "Score: ")))) (save-excursion (unless (and (stringp match) (> (length match) 0)) (error "No match")) @@ -956,7 +956,7 @@ EXTRA is the possible non-standard header." "Automatically mark articles with score below SCORE as read." (interactive (list (or (and current-prefix-arg (prefix-numeric-value current-prefix-arg)) - (string-to-int (read-string "Mark below: "))))) + (string-to-number (read-string "Mark below: "))))) (setq score (or score gnus-summary-default-score 0)) (gnus-score-set 'mark (list score)) (gnus-score-set 'touched '(t)) @@ -990,7 +990,7 @@ EXTRA is the possible non-standard header." "Automatically expunge articles with score below SCORE." (interactive (list (or (and current-prefix-arg (prefix-numeric-value current-prefix-arg)) - (string-to-int (read-string "Set expunge below: "))))) + (string-to-number (read-string "Set expunge below: "))))) (setq score (or score gnus-summary-default-score 0)) (gnus-score-set 'expunge (list score)) (gnus-score-set 'touched '(t))) diff --git a/lisp/gnus-soup.el b/lisp/gnus-soup.el index 4b1185a03..c959df595 100644 --- a/lisp/gnus-soup.el +++ b/lisp/gnus-soup.el @@ -349,9 +349,9 @@ If NOT-ALL, don't pack ticked articles." (packer (if (< (string-match "%s" packer) (string-match "%d" packer)) (format packer files - (string-to-int (gnus-soup-unique-prefix dir))) + (string-to-number (gnus-soup-unique-prefix dir))) (format packer - (string-to-int (gnus-soup-unique-prefix dir)) + (string-to-number (gnus-soup-unique-prefix dir)) files))) (dir (expand-file-name dir))) (gnus-make-directory dir) @@ -385,7 +385,7 @@ though the two last may be nil if they are missing." (and (eq (preceding-char) ?\t) (gnus-soup-field)) (and (eq (preceding-char) ?\t) - (string-to-int (gnus-soup-field)))) + (string-to-number (gnus-soup-field)))) areas) (when (eq (preceding-char) ?\t) (beginning-of-line 2))) @@ -535,7 +535,7 @@ Return whether the unpacking was successful." (error "Bad header")) (forward-line 1) (setq beg (point) - end (+ (point) (string-to-int + end (+ (point) (string-to-number (buffer-substring (match-beginning 1) (match-end 1))))) (switch-to-buffer tmp-buf) diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index 201c5dd80..5e7a5b87e 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -510,7 +510,7 @@ are supported for %s." (t (if (null args) (error 'wrong-number-of-arguments #'my-format n fstring)) - (let* ((minlen (string-to-int (or (match-string 2) ""))) + (let* ((minlen (string-to-number (or (match-string 2) ""))) (arg (car args)) (str (if (stringp arg) arg (format "%s" arg))) (lpad (null (match-string 1))) diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index c990667da..34d14624c 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -2533,7 +2533,7 @@ If FORCE is non-nil, the .newsrc file is read." (cond ((looking-at "[0-9]+") ;; We narrow and read a number instead of buffer-substring/ - ;; string-to-int because it's faster. narrow/widen is + ;; string-to-number because it's faster. narrow/widen is ;; faster than save-restriction/narrow, and save-restriction ;; produces a garbage object. (setq num1 (progn diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index e9d4263ed..436cbcdd5 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -5721,7 +5721,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (match-end 1))) (substring xrefs (match-beginning 1) (match-end 1)))) (setq number - (string-to-int (substring xrefs (match-beginning 2) + (string-to-number (substring xrefs (match-beginning 2) (match-end 2)))) (if (setq entry (gnus-gethash group xref-hashtb)) (setcdr entry (cons number (cdr entry))) diff --git a/lisp/gnus-uu.el b/lisp/gnus-uu.el index 1ffce742b..ba02db811 100644 --- a/lisp/gnus-uu.el +++ b/lisp/gnus-uu.el @@ -1194,7 +1194,7 @@ When called interactively, prompt for REGEXP." (ignore-errors (replace-match (format "%06d" - (string-to-int (buffer-substring + (string-to-number (buffer-substring (match-beginning 0) (match-end 0))))))) (setq string (buffer-substring 1 (point-max))) (setcar (car string-list) string) diff --git a/lisp/nnbabyl.el b/lisp/nnbabyl.el index 076f4515c..81304adb8 100644 --- a/lisp/nnbabyl.el +++ b/lisp/nnbabyl.el @@ -490,7 +490,7 @@ (when (re-search-forward "^X-Gnus-Newsgroup: +\\([^:]+\\):\\([0-9]+\\) " nil t) (cons (buffer-substring (match-beginning 1) (match-end 1)) - (string-to-int + (string-to-number (buffer-substring (match-beginning 2) (match-end 2))))))) (defun nnbabyl-insert-lines () diff --git a/lisp/nndb.el b/lisp/nndb.el index 820f0a183..d24cf31dd 100644 --- a/lisp/nndb.el +++ b/lisp/nndb.el @@ -196,7 +196,7 @@ article was posted to nndb") ;; otherwise, pull all of the following numbers into the list (re-search-forward "follows\r?\n?" nil t) (while (re-search-forward "^[0-9]+$" nil t) - (push (string-to-int (match-string 0)) list))) + (push (string-to-number (match-string 0)) list))) list)) (defun nndb-request-expire-articles-remote diff --git a/lisp/nndiary.el b/lisp/nndiary.el index 2aeb55f64..0a17cc108 100644 --- a/lisp/nndiary.el +++ b/lisp/nndiary.el @@ -601,7 +601,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)) @@ -820,7 +820,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) @@ -1279,14 +1279,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")) @@ -1313,12 +1313,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) diff --git a/lisp/nndoc.el b/lisp/nndoc.el index 47a3cbd02..a79483656 100644 --- a/lisp/nndoc.el +++ b/lisp/nndoc.el @@ -421,7 +421,7 @@ from the document.") (search-forward "\n\n" beg t) (re-search-backward "^Content-Length:[ \t]*\\([0-9]+\\) *$" end t) - (setq len (string-to-int (match-string 1))) + (setq len (string-to-number (match-string 1))) (search-forward "\n\n" beg t) (unless (= (setq len (+ (point) len)) (point-max)) (and (< len (point-max)) @@ -444,7 +444,7 @@ from the document.") (defun nndoc-rnews-body-end () (and (re-search-backward nndoc-article-begin nil t) (forward-line 1) - (goto-char (+ (point) (string-to-int (match-string 1)))))) + (goto-char (+ (point) (string-to-number (match-string 1)))))) (defun nndoc-babyl-type-p () (when (re-search-forward "\^_\^L *\n" nil t) diff --git a/lisp/nndraft.el b/lisp/nndraft.el index 95ff03742..62fa4a6f9 100644 --- a/lisp/nndraft.el +++ b/lisp/nndraft.el @@ -185,7 +185,7 @@ (file-name-coding-system nnmail-pathname-coding-system) dir file) (nnheader-re-read-dir pathname) - (setq dir (mapcar (lambda (name) (string-to-int (substring name 1))) + (setq dir (mapcar (lambda (name) (string-to-number (substring name 1))) (ignore-errors (directory-files pathname nil "^#[0-9]+#$" t)))) (dolist (n dir) @@ -293,7 +293,7 @@ "Return the list of messages in the group." (gnus-make-directory nndraft-current-directory) (sort - (mapcar 'string-to-int + (mapcar 'string-to-number (directory-files nndraft-current-directory nil "\\`[0-9]+\\'" t)) '<)) diff --git a/lisp/nneething.el b/lisp/nneething.el index e3b3d3412..997e537c2 100644 --- a/lisp/nneething.el +++ b/lisp/nneething.el @@ -329,7 +329,7 @@ included.") (when (re-search-forward "<[a-zA-Z0-9_]@[-a-zA-Z0-9_]>" 1000 t) (concat "From: " (match-string 0) "\n")))) (nneething-from-line (nth 2 atts) file)) - (if (> (string-to-int (int-to-string (nth 7 atts))) 0) + (if (> (string-to-number (int-to-string (nth 7 atts))) 0) (concat "Chars: " (int-to-string (nth 7 atts)) "\n") "") (if buffer diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el index 9b25ea146..b86a26b20 100644 --- a/lisp/nnfolder.el +++ b/lisp/nnfolder.el @@ -200,7 +200,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") ((search-backward (concat "\n" nnfolder-article-marker) nil t) (goto-char (match-end 0)) - (setq num (string-to-int + (setq num (string-to-number (buffer-substring (point) (point-at-eol)))) (goto-char start) @@ -210,7 +210,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") (search-forward (concat "\n" nnfolder-article-marker) nil t) (progn - (setq num (string-to-int + (setq num (string-to-number (buffer-substring (point) (point-at-eol)))) (> num article)) @@ -285,7 +285,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") (cons nnfolder-current-group (if (search-forward (concat "\n" nnfolder-article-marker) nil t) - (string-to-int (buffer-substring + (string-to-number (buffer-substring (point) (point-at-eol))) -1)))))))) diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 5ee9a7f9c..59b5ea31f 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -702,9 +702,9 @@ the line could be found." (defsubst nnheader-file-to-number (file) "Take a FILE name and return the article number." (if (string= nnheader-numerical-short-files "^[0-9]+$") - (string-to-int file) + (string-to-number file) (string-match nnheader-numerical-short-files file) - (string-to-int (match-string 0 file)))) + (string-to-number (match-string 0 file)))) (defvar nnheader-directory-files-is-safe (or (eq system-type 'windows-nt) diff --git a/lisp/nnkiboze.el b/lisp/nnkiboze.el index f14f6caa1..37c3e48f6 100644 --- a/lisp/nnkiboze.el +++ b/lisp/nnkiboze.el @@ -106,7 +106,7 @@ (error "nnkiboze: No xref")) (unless (string-match " \\([^ ]+\\):\\([0-9]+\\)" xref) (error "nnkiboze: Malformed xref")) - (setq num (string-to-int (match-string 2 xref)) + (setq num (string-to-number (match-string 2 xref)) group (match-string 1 xref)) (or (with-current-buffer buffer (or (and gnus-use-cache (gnus-cache-request-article num group)) diff --git a/lisp/nnmail.el b/lisp/nnmail.el index b522c1ce2..1d94460ed 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -768,7 +768,7 @@ If SOURCE is a directory spec, try to return the group name component." (if (not (save-excursion (and (re-search-backward "^Content-Length:[ \t]*\\([0-9]+\\)" start t) - (setq content-length (string-to-int + (setq content-length (string-to-number (buffer-substring (match-beginning 1) (match-end 1)))) @@ -905,7 +905,7 @@ If SOURCE is a directory spec, try to return the group name component." (if (not (re-search-forward "^Content-Length:[ \t]*\\([0-9]+\\)" nil t)) (setq content-length nil) - (setq content-length (string-to-int (match-string 1))) + (setq content-length (string-to-number (match-string 1))) ;; We destroy the header, since none of the backends ever ;; use it, and we do not want to confuse other mailers by ;; having a (possibly) faulty header. diff --git a/lisp/nnmbox.el b/lisp/nnmbox.el index 93172b758..2157d29ce 100644 --- a/lisp/nnmbox.el +++ b/lisp/nnmbox.el @@ -475,7 +475,7 @@ (when (re-search-forward "^X-Gnus-Newsgroup: +\\([^:]+\\):\\([0-9]+\\) " nil t) (cons (buffer-substring (match-beginning 1) (match-end 1)) - (string-to-int + (string-to-number (buffer-substring (match-beginning 2) (match-end 2))))))) (defun nnmbox-in-header-p (pos) @@ -681,7 +681,7 @@ (let (alist) (while (re-search-forward " \\([^:]+\\):\\([0-9]+\\)" end-header t) (push (cons (match-string 1) - (string-to-int (match-string 2))) alist)) + (string-to-number (match-string 2))) alist)) (nnmbox-insert-newsgroup-line alist)) ;; this is really a new article (nnmbox-save-mail diff --git a/lisp/nnmh.el b/lisp/nnmh.el index 7bc52211a..ba889ca4e 100644 --- a/lisp/nnmh.el +++ b/lisp/nnmh.el @@ -150,7 +150,7 @@ as unread by Gnus.") (file-exists-p file) (not (file-directory-p file)) (save-excursion (nnmail-find-file file)) - (string-to-int (file-name-nondirectory file))))) + (string-to-number (file-name-nondirectory file))))) (deffoo nnmh-request-group (group &optional server dont-check) (nnheader-init-server-buffer) @@ -176,7 +176,7 @@ as unread by Gnus.") (nnheader-re-read-dir pathname) (setq dir (sort - (mapcar 'string-to-int + (mapcar 'string-to-number (directory-files pathname nil "^[0-9]+$" t)) '<)) (cond @@ -222,7 +222,7 @@ as unread by Gnus.") (nnmh-request-list-1 rdir)))) ;; For each directory, generate an active file line. (unless (string= (expand-file-name nnmh-toplev) dir) - (let ((files (mapcar 'string-to-int + (let ((files (mapcar 'string-to-number (directory-files dir nil "^[0-9]+$" t)))) (when files (save-excursion @@ -354,7 +354,7 @@ as unread by Gnus.") nnmh-group-alist) (nnmh-possibly-create-directory group) (nnmh-possibly-change-directory group server) - (let ((articles (mapcar 'string-to-int + (let ((articles (mapcar 'string-to-number (directory-files nnmh-current-directory nil "^[0-9]+$")))) (when articles @@ -480,7 +480,7 @@ as unread by Gnus.") (gnus-make-directory dir)) ;; Find the highest number in the group. (let ((files (sort - (mapcar 'string-to-int + (mapcar 'string-to-number (directory-files dir nil "^[0-9]+$")) '>))) (when files @@ -503,7 +503,7 @@ as unread by Gnus.") ;; articles in this folder. The articles that are "new" will be ;; marked as unread by Gnus. (let* ((dir nnmh-current-directory) - (files (sort (mapcar 'string-to-int + (files (sort (mapcar 'string-to-number (directory-files nnmh-current-directory nil "^[0-9]+$" t)) '<)) diff --git a/lisp/nnml.el b/lisp/nnml.el index b99f47bec..29b0bc7f3 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -212,7 +212,7 @@ marks file will be regenerated properly by Gnus.") (nnheader-report 'nnml "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 nnml-request-group (group &optional server dont-check) (let ((file-name-coding-system nnmail-pathname-coding-system)) @@ -426,7 +426,7 @@ marks file will be regenerated properly by Gnus.") ;; 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) diff --git a/lisp/nnrss.el b/lisp/nnrss.el index cfe0e4b3c..113bc801a 100644 --- a/lisp/nnrss.el +++ b/lisp/nnrss.el @@ -900,7 +900,7 @@ whether they are `offsite' or `onsite'." (selection (mapcar (lambda (listinfo) (cons (cdr (assoc "sitename" listinfo)) - (string-to-int + (string-to-number (cdr (assoc "feedid" listinfo))))) feedinfo))) (cdr (assoc diff --git a/lisp/nnsoup.el b/lisp/nnsoup.el index fa24abe1d..40774d425 100644 --- a/lisp/nnsoup.el +++ b/lisp/nnsoup.el @@ -749,9 +749,9 @@ backend for the messages.") (let ((files (sort (directory-files nnsoup-directory t "IDX$") (lambda (f1 f2) (< (progn (string-match "/\\([0-9]+\\)\\." f1) - (string-to-int (match-string 1 f1))) + (string-to-number (match-string 1 f1))) (progn (string-match "/\\([0-9]+\\)\\." f2) - (string-to-int (match-string 1 f2))))))) + (string-to-number (match-string 1 f2))))))) active group lines ident elem min) (set-buffer (get-buffer-create " *nnsoup work*")) (dolist (file files) diff --git a/lisp/nnspool.el b/lisp/nnspool.el index 004b875b6..c12f804ad 100644 --- a/lisp/nnspool.el +++ b/lisp/nnspool.el @@ -247,7 +247,7 @@ there.") ;; Yes, completely empty spool directories *are* possible. ;; Fix by Sudish Joseph (when (setq dir (directory-files pathname nil "^[0-9]+$" t)) - (setq dir (sort (mapcar 'string-to-int dir) '<))) + (setq dir (sort (mapcar 'string-to-number dir) '<))) (if dir (nnheader-insert "211 %d %d %d %s\n" (length dir) (car dir) @@ -432,7 +432,7 @@ there.") (call-process "grep" nil t nil (regexp-quote id) nnspool-history-file)) (goto-char (point-min)) (when (looking-at "<[^>]+>[ \t]+[-0-9~]+[ \t]+\\([^ /\t\n]+\\)/\\([0-9]+\\)[ \t\n]") - (cons (match-string 1) (string-to-int (match-string 2)))))) + (cons (match-string 1) (string-to-number (match-string 2)))))) (defun nnspool-find-file (file) "Insert FILE in server buffer safely." diff --git a/lisp/nntp.el b/lisp/nntp.el index d5f46ef94..712499be5 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -1568,7 +1568,7 @@ password contained in '~/.nntp-authinfo'." (when (<= count 1) (goto-char (point-min)) (when (re-search-forward "^[0-9][0-9][0-9] .*\n\\([0-9]+\\)" nil t) - (let ((low-limit (string-to-int + (let ((low-limit (string-to-number (buffer-substring (match-beginning 1) (match-end 1))))) (while (and articles (<= (car articles) low-limit)) @@ -1638,7 +1638,7 @@ password contained in '~/.nntp-authinfo'." (goto-char (point-min)) ;; We first find the number by looking at the status line. (let ((number (and (looking-at "2[0-9][0-9] +\\([0-9]+\\) ") - (string-to-int + (string-to-number (buffer-substring (match-beginning 1) (match-end 1))))) newsgroups xref) @@ -1676,7 +1676,7 @@ password contained in '~/.nntp-authinfo'." "\\([^ :]+\\):\\([0-9]+\\)") xref)) (setq group (match-string 1 xref) - number (string-to-int (match-string 2 xref)))) + number (string-to-number (match-string 2 xref)))) ((and (setq newsgroups (mail-fetch-field "newsgroups")) (not (string-match "," newsgroups))) diff --git a/lisp/pgg-gpg.el b/lisp/pgg-gpg.el index 432f04f35..135aed058 100644 --- a/lisp/pgg-gpg.el +++ b/lisp/pgg-gpg.el @@ -252,7 +252,7 @@ If optional argument SIGN is non-nil, do a combined sign and encrypt." (when (re-search-forward "^\\[GNUPG:] IMPORT_RES\\>" nil t) (setq status (buffer-substring (match-end 0) (progn (end-of-line)(point))) - status (vconcat (mapcar #'string-to-int (split-string status)))) + status (vconcat (mapcar #'string-to-number (split-string status)))) (erase-buffer) (insert (format "Imported %d key(s). \tArmor contains %d key(s) [%d bad, %d old].\n" diff --git a/lisp/pgg-parse.el b/lisp/pgg-parse.el index dbdb0cbbb..af3803784 100644 --- a/lisp/pgg-parse.el +++ b/lisp/pgg-parse.el @@ -111,7 +111,7 @@ `(mapconcat (lambda (c) (format "%02X" (pgg-char-int c))) ,string "") ;; `(upcase (apply #'format "%02x%02x%02x%02x%02x%02x%02x%02x" - ;; (string-to-int-list ,string))) + ;; (string-to-number-list ,string))) ) (defmacro pgg-parse-time-field (bytes) @@ -134,7 +134,7 @@ (defmacro pgg-read-bytes (nbytes) `(mapcar #'pgg-char-int (pgg-read-bytes-string ,nbytes)) - ;; `(string-to-int-list (pgg-read-bytes-string ,nbytes)) + ;; `(string-to-number-list (pgg-read-bytes-string ,nbytes)) ) (defmacro pgg-read-body-string (ptag) @@ -144,7 +144,7 @@ (defmacro pgg-read-body (ptag) `(mapcar #'pgg-char-int (pgg-read-body-string ,ptag)) - ;; `(string-to-int-list (pgg-read-body-string ,ptag)) + ;; `(string-to-number-list (pgg-read-body-string ,ptag)) ) (defalias 'pgg-skip-bytes 'forward-char) diff --git a/lisp/pop3.el b/lisp/pop3.el index d3e6fea51..6e19b22bd 100644 --- a/lisp/pop3.el +++ b/lisp/pop3.el @@ -382,8 +382,8 @@ If NOW, use that time instead." "Return the number of messages in the maildrop and the maildrop's size." (pop3-send-command process "STAT") (let ((response (pop3-read-response process t))) - (list (string-to-int (nth 1 (split-string response " "))) - (string-to-int (nth 2 (split-string response " ")))) + (list (string-to-number (nth 1 (split-string response " "))) + (string-to-number (nth 2 (split-string response " ")))) )) (defun pop3-list (process &optional msg) @@ -433,7 +433,7 @@ This function currently does nothing.") "Return highest accessed message-id number for the session." (pop3-send-command process "LAST") (let ((response (pop3-read-response process t))) - (string-to-int (nth 1 (split-string response " "))) + (string-to-number (nth 1 (split-string response " "))) )) (defun pop3-rset (process) diff --git a/lisp/qp.el b/lisp/qp.el index 1004abeb0..a4a9a4a0c 100644 --- a/lisp/qp.el +++ b/lisp/qp.el @@ -69,7 +69,7 @@ them into characters should be done separately." (cond ((eq (char-after (1+ (point))) ?\n) (delete-char 2)) ((looking-at "=[0-9A-F][0-9A-F]") - (let ((byte (string-to-int (buffer-substring (1+ (point)) + (let ((byte (string-to-number (buffer-substring (1+ (point)) (+ 3 (point))) 16))) (mm-insert-byte byte 1) -- 2.25.1