X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/830e46e61ba1316e771c72a15e709d3d12e150b7..1b8dff239bf8091a75572064ff8fb085f3c073d6:/lisp/dired-x.el diff --git a/lisp/dired-x.el b/lisp/dired-x.el index a2c13033cd..3cf6654da2 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -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))))) ;;; MISCELLANEOUS INTERNAL FUNCTIONS.