From fadc43c5b36588c8869d501deee5b39b9b228885 Mon Sep 17 00:00:00 2001 From: hmurata Date: Fri, 11 Jan 2002 15:39:45 +0000 Subject: [PATCH] * elmo-util.el (elmo-file-cache-delete): Fixed last change; Return t if PATH is directory, too. Use `dolist' instead of while loop. --- elmo/ChangeLog | 6 ++++++ elmo/elmo-util.el | 18 ++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 161e5d3..9303ba4 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,9 @@ +2002-01-11 Hiroya Murata + + * elmo-util.el (elmo-file-cache-delete): Fixed last change; + Return t if PATH is directory, too. + Use `dolist' instead of while loop. + 2002-01-11 Yoichi NAKAYAMA * elmo-util.el (elmo-file-cache-delete): Return t if a cache file diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index dcdbd5c..835bf4b 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1569,16 +1569,14 @@ SECTION is the section string." (defun elmo-file-cache-delete (path) "Delete a cache on PATH." - (let (files) - (when (file-exists-p path) - (if (file-directory-p path) - (progn - (setq files (directory-files path t "^[^\\.]")) - (while files - (delete-file (car files)) - (setq files (cdr files))) - (delete-directory path)) - (progn (delete-file path) t))))) + (when (file-exists-p path) + (if (file-directory-p path) + (progn + (dolist (file (directory-files path t "^[^\\.]")) + (delete-file file)) + (delete-directory path)) + (delete-file path)) + t)) (defun elmo-file-cache-exists-p (msgid) "Returns 'section or 'entire if a cache which corresponds to MSGID exists." -- 1.7.10.4