X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=elmo%2Felmo-util.el;h=c493d00f8fd9f0f50e41bd7ed525cb77ac37fdc1;hb=ee2dd54f276eeeca395eccf46c125c45bce5c6d8;hp=365ffd209c96b9a4da1dbae6e3e41d62f853047f;hpb=e64882498d21cef2b964ddc18d41421ab36bd19b;p=elisp%2Fwanderlust.git diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 365ffd2..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) @@ -1050,8 +1054,7 @@ Otherwise treat \\ in NEWTEXT string as special: (elmo-make-directory parent)) (make-directory path) (if (string= path (expand-file-name elmo-msgdb-dir)) - (set-file-modes path 448) ; 700 - ))) + (set-file-modes path (+ (* 64 7) (* 8 0) 0))))) ; chmod 0700 (defun elmo-delete-directory (path &optional no-hierarchy) "Delete directory recursively." @@ -1441,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) @@ -1552,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."