+2000-11-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-util.el (elmo-flatten): New function.
+
2000-10-31 TAKAHASHI Kaoru <kaoru@kaisei.org>
* elmo-archive.el (toplevel): Added (C) to copyright notice, and
(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)
(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."