From bcdd299ffdc3037790bcd9eaf2c082835e8ccd45 Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 22 Jan 2007 06:20:22 +0000 Subject: [PATCH] Fixed. --- lisp/riece-mcat.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/riece-mcat.el b/lisp/riece-mcat.el index a11bb2a..3155b5c 100644 --- a/lisp/riece-mcat.el +++ b/lisp/riece-mcat.el @@ -46,7 +46,7 @@ (defun riece-mcat-extract (files) (save-excursion - (let (message-list alist) + (let (message-list) (while files (with-temp-buffer (insert-file-contents (car files)) @@ -61,12 +61,13 @@ (riece-mcat-extract-from-form (read (current-buffer))))))) (setq files (cdr files))) - (setq message-list (sort message-list #'string-lessp)) - (while message-list - (unless (assoc (car message-list) alist) - (setq alist (cons (list (car message-list)) alist))) - (setq message-list (cdr message-list))) - alist))) + (setq message-list (sort message-list #'string-lessp) + pointer message-list) + (while pointer + (if (member (car pointer) (cdr pointer)) + (setcar pointer nil)) + (setq pointer (cdr pointer))) + (delq nil message-list)))) (defun riece-mcat-update (files mcat-file mcat-alist-symbol) "Update MCAT-FILE." @@ -85,7 +86,10 @@ (eval (read (current-buffer)))) (delete-region (point) (progn (forward-sexp) (point)))) (set mcat-alist-symbol nil)) - (setq alist (riece-mcat-extract files)) + (setq alist (mapcar (lambda (message) + (or (assoc message (symbol-name mcat-alist-symbol)) + (list message))) + (riece-mcat-extract files))) (insert "(defconst " (symbol-name mcat-alist-symbol) "\n '(") (while alist (insert "(" (pp-to-string (car (car alist))) " . " -- 1.7.10.4