Function: browse-url-of-dired-file

browse-url-of-dired-file is an autoloaded, interactive and byte-compiled function defined in browse-url.el.gz.

Signature

(browse-url-of-dired-file &optional SECONDARY)

Documentation

In Dired, ask a WWW browser to display the file named on this line.

With prefix arg, use the secondary browser instead (e.g. EWW if browse-url-secondary-browser-function is set to eww-browse-url.

View in manual

Probably introduced at or before Emacs version 26.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/browse-url.el.gz
;;;###autoload
(defun browse-url-of-dired-file (&optional secondary)
  "In Dired, ask a WWW browser to display the file named on this line.
With prefix arg, use the secondary browser instead (e.g. EWW if
`browse-url-secondary-browser-function' is set to
`eww-browse-url'."
  (interactive "P")
  (let ((tem (dired-get-filename t t))
        (browse-url-browser-function
         (if secondary
             browse-url-secondary-browser-function
           browse-url-browser-function))
        ;; Some URL handlers open files in Emacs.  We want to always
        ;; open in a browser, so disable those.
        (browse-url-default-handlers nil))
    (if tem
	(browse-url-of-file (expand-file-name tem))
      (error "No file on this line"))))