From dcc6250a9d98ffdc2d048344c9faedb54ead6b34 Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 1 Nov 2000 03:04:04 +0000 Subject: [PATCH] * elmo-util.el (elmo-flatten): New function. --- elmo/ChangeLog | 4 ++++ elmo/elmo-util.el | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 4ea16a8..df36686 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,7 @@ +2000-11-01 Yuuichi Teranishi + + * elmo-util.el (elmo-flatten): New function. + 2000-10-31 TAKAHASHI Kaoru * elmo-archive.el (toplevel): Added (C) to copyright notice, and diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 71b12c2..917ddc2 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -667,7 +667,11 @@ Return value is a cons cell of (STRUCTURE . REST)" (defun elmo-uniq-list (lst) "Distractively uniqfy elements of LST." (let ((tmp lst)) - (while tmp (setq tmp (setcdr tmp (and (cdr tmp) (delete (car tmp) (cdr tmp))))))) + (while tmp (setq tmp + (setcdr tmp + (and (cdr tmp) + (delete (car tmp) + (cdr tmp))))))) lst) (defun elmo-string-partial-p (string) @@ -1551,6 +1555,15 @@ the value of `foo'." (set-text-properties 0 (length obj) nil obj) obj))) +(defun elmo-flatten (list-of-list) + "Flatten LIST-OF-LIST." + (unless (null list-of-list) + (append (if (and (car list-of-list) + (listp (car list-of-list))) + (car list-of-list) + (list (car list-of-list))) + (elmo-flatten (cdr list-of-list))))) + (defun elmo-y-or-n-p (prompt &optional auto default) "Same as `y-or-n-p'. But if optional argument AUTO is non-nil, DEFAULT is returned." -- 1.7.10.4