X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=elmo%2Felmo-util.el;h=c493d00f8fd9f0f50e41bd7ed525cb77ac37fdc1;hb=ee2dd54f276eeeca395eccf46c125c45bce5c6d8;hp=5fc32e4b2cdda28ad0f638d25119c53074be2685;hpb=5325fdb0a3cc321570b102291327983bfee28e0c;p=elisp%2Fwanderlust.git diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 5fc32e4..c493d00 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1,6 +1,6 @@ ;;; elmo-util.el -- Utilities for Elmo. -;; Copyright 1998,1999,2000 Yuuichi Teranishi +;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi ;; Author: Yuuichi Teranishi ;; Keywords: mail, net news @@ -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) @@ -1440,8 +1444,7 @@ Emacs 19.28 or earlier does not have `unintern'." (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) @@ -1551,6 +1554,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."