changeset 68212:0c77c0b9a620

* mh-comp.el (mh-show-buffer-message-number): Replace (car (read-from-string string) with (string-to-number string). * mh-e.el (mh-parse-flist-output-line, mh-folder-size-folder): Ditto. * mh-mime.el (mh-mml-forward-message): Ditto. * mh-search.el (mh-swish-next-result, mh-mairix-next-result) (mh-namazu-next-result, mh-grep-next-result, mh-md5sum-parser) (mh-openssl-parser, mh-index-update-maps): Ditto. * mh-seq.el (mh-translate-range, mh-narrow-to-header-field) (mh-thread-generate): Ditto.
author Bill Wohler <wohler@newt.com>
date Mon, 16 Jan 2006 20:05:14 +0000
parents 3299c642df41
children a08b47775f9b
files lisp/mh-e/ChangeLog lisp/mh-e/mh-comp.el lisp/mh-e/mh-e.el lisp/mh-e/mh-mime.el lisp/mh-e/mh-search.el lisp/mh-e/mh-seq.el
diffstat 6 files changed, 47 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mh-e/ChangeLog	Mon Jan 16 19:42:53 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Mon Jan 16 20:05:14 2006 +0000
@@ -1,8 +1,25 @@
+2006-01-16  Bill Wohler  <wohler@newt.com>
+
+	* mh-comp.el (mh-show-buffer-message-number): Replace (car
+	(read-from-string string) with (string-to-number string).
+
+	* mh-e.el (mh-parse-flist-output-line, mh-folder-size-folder):
+	Ditto.
+
+	* mh-mime.el (mh-mml-forward-message): Ditto.
+
+	* mh-search.el (mh-swish-next-result, mh-mairix-next-result)
+	(mh-namazu-next-result, mh-grep-next-result, mh-md5sum-parser)
+	(mh-openssl-parser, mh-index-update-maps): Ditto.
+
+	* mh-seq.el (mh-translate-range, mh-narrow-to-header-field)
+	(mh-thread-generate): Ditto.
+
 2006-01-16  Mark D. Baushke  <mdb@gnu.org>
 
 	* mh-mime.el (mh-mime-display, mh-mm-inline-message): Fix use of
-	mm- functions for proper text=flowed handling. (SF #1273521)
-	(Patch contributed by Katsumi Yamaoka <yamaoka@jpl.org>.)
+	mm- functions for proper text=flowed handling (closes SF
+	#1273521). Patch contributed by Katsumi Yamaoka <yamaoka@jpl.org>.
 
 2006-01-15  Bill Wohler  <wohler@newt.com>
 
--- a/lisp/mh-e/mh-comp.el	Mon Jan 16 19:42:53 2006 +0000
+++ b/lisp/mh-e/mh-comp.el	Mon Jan 16 20:05:14 2006 +0000
@@ -522,8 +522,8 @@
         (set-buffer buffer))
     (cond ((eq major-mode 'mh-show-mode)
            (let ((number-start (mh-search-from-end ?/ buffer-file-name)))
-             (car (read-from-string (substring buffer-file-name
-                                               (1+ number-start))))))
+             (string-to-number (substring buffer-file-name
+                                          (1+ number-start)))))
           ((and (eq major-mode 'mh-folder-mode)
                 mh-show-buffer
                 (get-buffer mh-show-buffer))
--- a/lisp/mh-e/mh-e.el	Mon Jan 16 19:42:53 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Mon Jan 16 20:05:14 2006 +0000
@@ -1372,13 +1372,13 @@
     (goto-char (point-max))
     (let (folder unseen total p)
       (when (search-backward " out of " (point-min) t)
-        (setq total (read-from-string
+        (setq total (string-to-number
                      (buffer-substring-no-properties
                       (match-end 0) (line-end-position))))
         (when (search-backward " in sequence " (point-min) t)
           (setq p (point))
           (when (search-backward " has " (point-min) t)
-            (setq unseen (read-from-string (buffer-substring-no-properties
+            (setq unseen (string-to-number (buffer-substring-no-properties
                                             (match-end 0) p)))
             (while (eq (char-after) ? )
               (backward-char))
@@ -1387,7 +1387,7 @@
             (when (and (equal (aref folder (1- (length folder))) ?+)
                        (equal current-folder folder))
               (setq folder (substring folder 0 (1- (length folder)))))
-            (values (format "+%s" folder) (car unseen) (car total))))))))
+            (values (format "+%s" folder) unseen total)))))))
 
 (defun mh-folder-size-folder (folder)
   "Find size of FOLDER using \"folder\"."
@@ -1398,7 +1398,7 @@
                     "-norecurse" folder)
       (goto-char (point-min))
       (if (re-search-forward " has \\([0-9]+\\) " nil t)
-          (values (car (read-from-string (match-string 1))) u folder)
+          (values (string-to-number (match-string 1)) u folder)
         (values 0 u folder)))))
 
 (defun mh-folder-size-flist (folder)
--- a/lisp/mh-e/mh-mime.el	Mon Jan 16 19:42:53 2006 +0000
+++ b/lisp/mh-e/mh-mime.el	Mon Jan 16 20:05:14 2006 +0000
@@ -543,7 +543,7 @@
 MESSAGE number."
   (let ((msg (if (and (equal message "") (numberp mh-sent-from-msg))
                  mh-sent-from-msg
-               (car (read-from-string message)))))
+               (string-to-number message))))
     (cond ((integerp msg)
            (if (string= "" description)
                ;; Rationale: mml-attach-file constructs a malformed composition
--- a/lisp/mh-e/mh-search.el	Mon Jan 16 19:42:53 2006 +0000
+++ b/lisp/mh-e/mh-search.el	Mon Jan 16 20:05:14 2006 +0000
@@ -1105,10 +1105,8 @@
                               (substring s (match-end 0) (1- (length s))))
                     (return 'error)))
                 (let* ((s (buffer-substring-no-properties (1+ (point)) end))
-                       (val (ignore-errors (read-from-string s))))
-                  (if (and (consp val) (numberp (car val)))
-                      (car val)
-                    (return 'error)))
+                       (n (ignore-errors (string-to-number s))))
+                  (if n n (return 'error)))
                 nil)))
     (forward-line)))
 
@@ -1184,8 +1182,8 @@
             (return 'error))
           (list (format "+%s" (buffer-substring-no-properties
                                (point) (1- msg-start)))
-                (car (read-from-string
-                      (buffer-substring-no-properties msg-start end)))
+                (string-to-number
+                 (buffer-substring-no-properties msg-start end))
                 nil)))
     (forward-line)))
 
@@ -1313,11 +1311,9 @@
                  (mark (mh-search-from-end ?/ folder/msg)))
             (unless mark (return 'error))
             (list (format "+%s" (substring folder/msg 0 mark))
-                  (let ((n (ignore-errors (read-from-string
+                  (let ((n (ignore-errors (string-to-number
                                            (substring folder/msg (1+ mark))))))
-                    (if (and (consp n) (numberp (car n)))
-                        (car n)
-                      (return 'error)))
+                    (if n n (return 'error)))
                   nil))))
     (forward-line)))
 
@@ -1458,12 +1454,10 @@
               (return 'error))
             (list (format "+%s" (buffer-substring-no-properties
                                  folder-start (point)))
-                  (let ((val (ignore-errors (read-from-string
-                                             (buffer-substring-no-properties
-                                              (1+ (point)) msg-end)))))
-                    (if (and (consp val) (integerp (car val)))
-                        (car val)
-                      (return 'error)))
+                  (let ((n (ignore-errors (string-to-number
+                                           (buffer-substring-no-properties
+                                            (1+ (point)) msg-end)))))
+                    (if n n (return 'error)))
                   match))))
     (forward-line)))
 
@@ -1804,8 +1798,8 @@
     (goto-char end)
     (setq last-slash (search-backward "/" begin t))
     (cond ((and first-space last-slash)
-           (cons (car (read-from-string (buffer-substring-no-properties
-                                         (1+ last-slash) end)))
+           (cons (string-to-number (buffer-substring-no-properties
+                                    (1+ last-slash) end))
                  (buffer-substring-no-properties begin (1- first-space))))
           (t (cons nil nil)))))
 
@@ -1818,8 +1812,8 @@
     (setq last-space (search-backward " " begin t))
     (setq last-slash (search-backward "/" begin t))
     (cond ((and last-slash last-space)
-           (cons (car (read-from-string (buffer-substring-no-properties
-                                         (1+ last-slash) (1- last-space))))
+           (cons (string-to-number (buffer-substring-no-properties
+                                    (1+ last-slash) (1- last-space)))
                  (buffer-substring-no-properties (1+ last-space) end))))))
 
 (defalias 'mh-md5-parser 'mh-openssl-parser)
@@ -1858,7 +1852,7 @@
                    ;; update maps
                    (setq checksum (buffer-substring-no-properties
                                    (point) (line-end-position)))
-                   (let ((msg (car (read-from-string msg))))
+                   (let ((msg (string-to-number msg)))
                      (set-buffer folder)
                      (mh-index-update-single-msg msg checksum origin-map)))))
           (forward-line))))
--- a/lisp/mh-e/mh-seq.el	Mon Jan 16 19:42:53 2006 +0000
+++ b/lisp/mh-e/mh-seq.el	Mon Jan 16 20:05:14 2006 +0000
@@ -560,7 +560,7 @@
         (set-buffer mh-temp-buffer)
         (goto-char (point-min))
         (while (re-search-forward "/\\([0-9]*\\)$" nil t)
-          (push (car (read-from-string (match-string 1))) result))
+          (push (string-to-number (match-string 1)) result))
         (nreverse result)))))
 
 (defun mh-seq-names (seq-list)
@@ -928,9 +928,10 @@
              (append original (list "-list") pick-expr))
       (goto-char (point-min))
       (while (not (eobp))
-        (let ((num (read-from-string
-                    (buffer-substring (point) (line-end-position)))))
-          (when (numberp (car num)) (push (car num) msg-list))
+        (let ((num (ignore-errors
+                     (string-to-number
+                      (buffer-substring (point) (line-end-position))))))
+          (when num (push num msg-list))
           (forward-line))))
     (if (null msg-list)
         (message "No matches")
@@ -1350,7 +1351,7 @@
             (let* ((index-line
                     (prog1 (buffer-substring (point) (line-end-position))
                       (forward-line)))
-                   (index (car (read-from-string index-line)))
+                   (index (string-to-number index-line))
                    (id (prog1 (buffer-substring (point) (line-end-position))
                          (forward-line)))
                    (refs (prog1 (buffer-substring (point) (line-end-position))