From: Stefan Kangas Date: Sat, 2 Jul 2022 20:17:06 +0000 (+0200) Subject: Improve dired-do-{info,man} error handling X-Git-Tag: emacs-29.0.90~1447^2~1249 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=60f77c58f1139e0196d859844d74cdfea5f264cf;p=emacs.git Improve dired-do-{info,man} error handling * lisp/dired.el (dired-do-man, dired-do-info): Use 'dired-get-file-for-visit' to get better error handling. Interactive mode tagging. --- diff --git a/lisp/dired.el b/lisp/dired.el index d7bf6316882..6fe0ba0be65 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -4810,22 +4810,22 @@ Interactively with prefix argument, read FILE-NAME." (defvar manual-program) ; from man.el (defun dired-do-man () - "Run `man' on this file." - (interactive) + "In Dired, run `man' on this file." + (interactive nil dired-mode) (require 'man) ;; FIXME: Move `dired-guess-shell-command' to dired.el to remove the ;; need for requiring `dired-x'. (require 'dired-x) - (let* ((file (dired-get-filename)) + (let* ((file (dired-get-file-for-visit)) (manual-program (string-replace "*" "%s" (dired-guess-shell-command "Man command: " (list file))))) (Man-getpage-in-background file))) (defun dired-do-info () - "Run `info' on this file." - (interactive) - (info (dired-get-filename))) + "In Dired, run `info' on this file." + (interactive nil dired-mode) + (info (dired-get-file-for-visit))) (provide 'dired)