Fix last change.
authorteranisi <teranisi>
Tue, 10 Oct 2000 02:59:01 +0000 (02:59 +0000)
committerteranisi <teranisi>
Tue, 10 Oct 2000 02:59:01 +0000 (02:59 +0000)
* elmo-multi.el (elmo-multi-split-mark-alist): Copy and sort alist before
splitting.
(elmo-multi-split-number-alist): Ditto.

elmo/ChangeLog
elmo/elmo-multi.el

index 6f4ff74..4ade1a5 100644 (file)
@@ -1,3 +1,9 @@
+2000-10-10  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-multi.el (elmo-multi-split-mark-alist): Copy and sort alist
+       before splitting.
+       (elmo-multi-split-number-alist): Ditto.
+
 2000-10-10  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * elmo-version.el: New file.  Use product.el.
index f196354..a54659b 100644 (file)
 
 (defun elmo-multi-split-mark-alist (mark-alist)
   (let ((cur-number 0)
+       (alist (sort (copy-sequence mark-alist)
+                    (lambda (pair1 pair2)
+                      (< (car pair1)(car pair2)))))
        one-alist result)
-    (while mark-alist
+    (while alist
       (setq cur-number (+ cur-number 1))
       (setq one-alist nil)
-      (while (and mark-alist
+      (while (and alist
                  (eq 0
-                     (/ (- (car (car mark-alist))
+                     (/ (- (car (car alist))
                            (* elmo-multi-divide-number cur-number))
                         elmo-multi-divide-number)))
        (setq one-alist (nconc
                         one-alist
                         (list
-                         (list (% (car (car mark-alist))
+                         (list (% (car (car alist))
                                   (* elmo-multi-divide-number cur-number))
-                               (cadr (car mark-alist))))))
-       (setq mark-alist (cdr mark-alist)))
+                               (cadr (car alist))))))
+       (setq alist (cdr alist)))
       (setq result (nconc result (list one-alist))))
     result))
 
 (defun elmo-multi-split-number-alist (number-alist)
-  (let ((alist number-alist)
+  (let ((alist (sort (copy-sequence number-alist)
+                    (lambda (pair1 pair2)
+                      (< (car pair1)(car pair2)))))
        (cur-number 0)
        one-alist split num)
     (while alist