Apply SSL patch.
[elisp/wanderlust.git] / elmo / elmo-util.el
index 365ffd2..c493d00 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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
@@ -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."