From 65c64058b817f169e356ea7825d173eb4c27fcf6 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 25 Dec 2015 20:36:54 +0100 Subject: [PATCH] Add a command to view files in the browser to dired * lisp/dired.el (dired-mode-map): Add the `W' command (bug#18810). --- doc/emacs/dired.texi | 7 +++++++ etc/NEWS | 4 ++++ lisp/dired.el | 1 + 3 files changed, 12 insertions(+) diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index e7e49445b54..04cef3848db 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -1414,6 +1414,13 @@ names into arguments for other Emacs commands. It also displays what it added to the kill ring, so you can use it to display the list of currently marked files in the echo area. +@kindex W @r{(Dired)} +@findex browse-url-of-dired-file + If you have an HTML file in the file listing, it can be useful to +view that file with a browser. The @kbd{W} +(@code{browse-url-of-dired-file}) command will use the standard +configured browser to view that file. + @kindex ( @r{(Dired)} @findex dired-hide-details-mode @vindex dired-hide-details-hide-symlink-targets diff --git a/etc/NEWS b/etc/NEWS index 76fac3e03cd..edd81476c17 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -900,6 +900,10 @@ compress many marked files into a single named archive. The compression command is determined from the new `dired-compress-files-alist' variable. ++++ +*** `W' is now bound to `browse-url-of-dired-file', and is useful for +viewing HTML files and the like. + ** Obsolete packages --- diff --git a/lisp/dired.el b/lisp/dired.el index ab6a820c29e..0a1b064fb20 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1538,6 +1538,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (define-key map "u" 'dired-unmark) (define-key map "v" 'dired-view-file) (define-key map "w" 'dired-copy-filename-as-kill) + (define-key map "W" 'browse-url-of-dired-file) (define-key map "x" 'dired-do-flagged-delete) (define-key map "y" 'dired-show-file-type) (define-key map "+" 'dired-create-directory) -- 2.39.2