]> git.eshelyaron.com Git - emacs.git/commitdiff
Synch with Gnus trunk.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 2 Jun 2010 00:10:42 +0000 (00:10 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 2 Jun 2010 00:10:42 +0000 (00:10 +0000)
(gnus-article-browse-delete-temp-files): Don't make query
 for each temp file when gnus-article-browse-delete-temp is ask.

lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el

index 26543c4048acacdebd21a54c8838c97e47c0da9f..c90e7c7a9ebc41595f46b81a19e7c44e11fb4dba 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-02  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-browse-delete-temp-files): Don't make query
+       for each temp file when gnus-article-browse-delete-temp is ask.
+
 2010-05-20  Kevin Ryde  <user42@zip.com.au>
 
        * gnus-start.el (gnus-level-unsubscribed): Doc fix.  (Bug#6206)
index 0659ee893def27b7e0401fa470604d55d7c127af..2707b51134ccc60526256813057ddfc7fb8a1cd1 100644 (file)
@@ -2806,22 +2806,28 @@ summary buffer."
 (defun gnus-article-browse-delete-temp-files (&optional how)
   "Delete temp-files created by `gnus-article-browse-html-parts'."
   (when (and gnus-article-browse-html-temp-list
-            (or how
-                (setq how gnus-article-browse-delete-temp)))
-    (when (and (eq how 'ask)
-              (gnus-y-or-n-p (format
-                              "Delete all %s temporary HTML file(s)? "
-                              (length gnus-article-browse-html-temp-list)))
-              (setq how t)))
+            (progn
+              (or how (setq how gnus-article-browse-delete-temp))
+              (if (eq how 'ask)
+                  (let ((files (length gnus-article-browse-html-temp-list)))
+                    (gnus-y-or-n-p (format
+                                    "Delete all %s temporary HTML file%s? "
+                                    files
+                                    (if (> files 1) "s" ""))))
+                how)))
     (dolist (file gnus-article-browse-html-temp-list)
-      (when (and (file-exists-p file)
-                (or (eq how t)
-                    ;; `how' is neither `nil', `ask' nor `t' (i.e. `file'):
-                    (gnus-y-or-n-p
-                     (format "Delete temporary HTML file `%s'? " file))))
-       (if (file-directory-p file)
-           (gnus-delete-directory file)
-         (delete-file file))))
+      (cond ((file-directory-p file)
+            (when (or (not (eq how 'file))
+                      (gnus-y-or-n-p
+                       (format
+                        "Delete temporary HTML file(s) in directory `%s'? "
+                        (file-name-as-directory file))))
+              (gnus-delete-directory file)))
+           ((file-exists-p file)
+            (when (or (not (eq how 'file))
+                      (gnus-y-or-n-p
+                       (format "Delete temporary HTML file `%s'? " file)))
+              (delete-file file)))))
     ;; Also remove file from the list when not deleted or if file doesn't
     ;; exist anymore.
     (setq gnus-article-browse-html-temp-list nil))