;;; elmo-util.el -- Utilities for Elmo.
-;; Copyright 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
(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)
(defsubst elmo-copy-file (src dst)
(condition-case err
(elmo-add-name-to-file src dst t)
- (error (copy-file src dst t)
- (error "Copy file failed"))))
+ (error (copy-file src dst t))))
(defsubst elmo-buffer-exists-p (buffer)
(if (bufferp buffer)
(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."