]> git.eshelyaron.com Git - emacs.git/commitdiff
* dired-x.el (dired-do-run-mail): Prompt for confirmation.
authorChong Yidong <cyd@gnu.org>
Sat, 9 Feb 2013 05:09:02 +0000 (13:09 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 9 Feb 2013 05:09:02 +0000 (13:09 +0800)
Fixes: debbugs:13561
lisp/ChangeLog
lisp/dired-x.el
lisp/dired.el

index 3dea3ed03803cf5cb43fc201df9a6c1af473ea5b..6e1fe6d20cea22e38b1943adabe4e5ffd005084f 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-09  Chong Yidong  <cyd@gnu.org>
+
+       * dired-x.el (dired-do-run-mail): Prompt for confirmation
+       (Bug#13561).
+
 2013-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/byte-run.el (eval-when-compile, eval-and-compile):
index a2c13033cd107d4778f4518e6bc3fac5feeb12a5..3cf6654da2b4148eeef2528e1c92a970c7e3973b 100644 (file)
@@ -1344,13 +1344,20 @@ Otherwise obeys the value of `dired-vm-read-only-folders'."
   (rmail (dired-get-filename)))
 
 (defun dired-do-run-mail ()
-  "If `dired-bind-vm' is non-nil, call `dired-vm', else call `dired-rmail'."
+  "Visit the current file as a mailbox, using VM or RMAIL.
+Prompt for confirmation first; if the user says yes, call
+`dired-vm' if `dired-bind-vm' is non-nil, `dired-rmail'
+otherwise."
   (interactive)
-  (if dired-bind-vm
-      ;; Read mail folder using vm.
-      (dired-vm)
-    ;; Read mail folder using rmail.
-    (dired-rmail)))
+  (let ((file (dired-get-filename t)))
+    (if dired-bind-vm
+       (if (y-or-n-p (concat "Visit `" file
+                             "' as a mail folder with VM?"))
+           (dired-vm))
+      ;; Read mail folder using rmail.
+      (if (y-or-n-p (concat "Visit `" file
+                           "' as a mailbox with RMAIL?"))
+         (dired-rmail)))))
 
 \f
 ;;; MISCELLANEOUS INTERNAL FUNCTIONS.
index 3006948858601d9f11d47ec35cef722b8f7611d4..b5fc46eb78dd3a2c8f8f618b1a89a59a0b4af3ba 100644 (file)
@@ -4297,7 +4297,7 @@ instead.
 ;;;***
 \f
 ;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
-;;;;;;  "dired-x" "dired-x.el" "cdaacce7c861256289ba48493dd6d0ec")
+;;;;;;  "dired-x" "dired-x.el" "90ba5245f6f5df3bdbda6303c725ef45")
 ;;; Generated autoloads from dired-x.el
 
 (autoload 'dired-jump "dired-x" "\