From 9041da3cb714676c25dad85e6cd4a80b3755d4c8 Mon Sep 17 00:00:00 2001 From: hmurata Date: Fri, 25 Aug 2006 14:29:16 +0000 Subject: [PATCH] (elmo-flatten): Use `append' and `listp' instead of `nconc' and `consp'. --- elmo/ChangeLog | 5 +++++ elmo/elmo-util.el | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 873baca..f2e6caf 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2006-08-25 Hiroya Murata + + * elmo-util.el (elmo-flatten): Use `append' and `listp' instead of + `nconc' and `consp'. + 2006-08-23 Hiroya Murata * elmo-map.el (elmo-map-folder-update-locations): Rewrite with diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 2202faf..85368a0 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1306,11 +1306,11 @@ SPEC is a list as followed (LABEL MAX-VALUE [FORMAT])." (defun elmo-flatten (list-of-list) "Flatten LIST-OF-LIST." - (if list-of-list - (apply #'nconc - (mapcar (lambda (element) - (if (consp element) element (list element))) - list-of-list)))) + (and list-of-list + (apply #'append + (mapcar (lambda (element) + (if (listp element) element (list element))) + list-of-list)))) (defun elmo-y-or-n-p (prompt &optional auto default) "Same as `y-or-n-p'. -- 1.7.10.4