[mew-dist 26359] Re: mew-nmz-setup
Hideyuki SHIRAI ( 白井秀行 )
shirai at example.com
2005年 5月 26日 (木) 16:04:27 JST
From: Kazu Yamamoto (山本和彦) <kazu at example.com> さん曰く
Subject: [mew-dist 26358] Re: mew-nmz-setup
Message-ID: <20050526.152444.20054145.kazu at example.com>
Date: Thu, 26 May 2005 15:24:44 +0900 (JST)
> > これは、nconc の方が cons より『速い』とずーーと思っていたからな
> > のですが、実験してみたら、cons の方が速いや。。。
>
> nconc を使うたびに、リストの尻尾を捕まえるために、リストの最後までなめ
> る作業が発生するんですよ。
はずかしいので、もう一度パッチよろしく ^^;;;
--
白井秀行 (mailto:shirai at example.com)
Index: mew-nmz.el
===================================================================
RCS file: /cvsmew/mew/mew-nmz.el,v
retrieving revision 1.24
diff -u -r1.24 mew-nmz.el
--- mew-nmz.el 26 May 2005 06:15:48 -0000 1.24
+++ mew-nmz.el 26 May 2005 07:03:04 -0000
@@ -569,9 +569,9 @@
(file-exists-p dir)
(file-directory-p dir)
(file-exists-p (expand-file-name mew-summary-touch-file dir)))
- (setq flist (nconc flist (list (directory-file-name fld)))))))))
+ (setq flist (cons (directory-file-name fld) flist)))))))
(prog1
- flist
+ (setq flist (nreverse flist))
(with-temp-buffer
(while (setq fld (car flist))
(unless (mew-nmz-skip-folder-p fld)
@@ -607,8 +607,9 @@
(mew-nmz-setup)
(setq alist mew-nmz-fld-index-alist)
(while alist
- (setq flist (nconc flist (list (car (car alist)))))
+ (setq flist (cons (car (car alist)) flist))
(setq alist (cdr alist))))
+ (setq flist (nreverse flist))
;; for mew-nmz-mknmz()
(setq current-prefix-arg nil)
(setq mew-nmz-mknmz-all-folders flist)
@@ -1531,9 +1532,7 @@
(defun mew-nmz-gather-indexed-folder (case folders-alist &optional proto)
(let ((ocase case)
- (fld-index-alist (copy-sequence '(0)))
- (url-fld-alist (copy-sequence '(0)))
- fld nmzdir)
+ fld nmzdir fld-index-alist url-fld-alist)
(unless case (setq case ""))
(while (setq fld (car (car folders-alist)))
(when (eq proto 'imap)
@@ -1546,13 +1545,13 @@
(setq nmzdir (mew-nmz-expand-folder fld))
(file-directory-p nmzdir)
(file-exists-p (expand-file-name "NMZ.i" nmzdir)))
- (nconc fld-index-alist (list (cons fld nmzdir)))
- (nconc url-fld-alist (list (cons (mew-expand-folder fld) fld))))
+ (setq fld-index-alist (cons (cons fld nmzdir) fld-index-alist))
+ (setq url-fld-alist (cons (cons (mew-expand-folder fld) fld) url-fld-alist)))
(setq folders-alist (cdr folders-alist)))
(setq mew-nmz-fld-index-alist
- (nconc mew-nmz-fld-index-alist (cdr fld-index-alist)))
+ (append mew-nmz-fld-index-alist (nreverse fld-index-alist)))
(setq mew-nmz-url-fld-alist
- (nconc mew-nmz-url-fld-alist (cdr url-fld-alist)))))
+ (append mew-nmz-url-fld-alist (nreverse url-fld-alist)))))
(defun mew-nmz-setup ()
(unless mew-nmz-setup-p
Mew-dist メーリングリストの案内