From 8caf78dd3dde7aa417688cbecac0addbb72ab5b7 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 24 May 2024 20:55:30 +0300 Subject: [PATCH] * lisp/dired.el (dired-mode-map): Bind "E" to 'dired-do-open' (bug#18132). (dired-mode-immediate-menu): Add menu item "Display Externally" for 'dired-do-open'. * lisp/dired-aux.el (dired-do-open): Add autoload cookie. (cherry picked from commit 9ebe6aa5f1092241a98e0a16db918e3dc1062f1c) --- etc/NEWS | 8 ++++---- lisp/dired-aux.el | 1 + lisp/dired.el | 7 +++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 236a9d2525b..920d7c516cf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -809,10 +809,10 @@ and a universal command such as "open" or "start" that delegates to the OS. *** New command 'dired-do-open'. -This command is bound to "Open" in the context menu; it "opens" the -marked or clicked on files according to the OS conventions. For -example, on systems supporting XDG, this runs 'xdg-open' on the -files. +This command is bound to 'E' (mnemonics "External"). Also it can be +used by clicking "Open" in the context menu; it "opens" the marked or +clicked on files according to the OS conventions. For example, on +systems supporting XDG, this runs 'xdg-open' on the files. *** New variable 'dired-guess-shell-alist-optional'. It contains commands for external viewers and players for various media diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index fcd1269529a..db86e2205bb 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1437,6 +1437,7 @@ This excludes `dired-guess-shell-alist-user' and (declare-function w32-shell-execute "w32fns.c") +;;;###autoload (defun dired-do-open (&optional arg) "Open all marked (or next ARG) files using an external program. This \"opens\" the file(s) using the external command that is most diff --git a/lisp/dired.el b/lisp/dired.el index 2b1db9f6e31..f2a75df6ef1 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2276,9 +2276,10 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." "~" #'dired-flag-backup-files ;; Upper case keys (except !) for operating on the marked files "A" #'dired-do-find-regexp - "C" #'dired-do-copy "B" #'dired-do-byte-compile + "C" #'dired-do-copy "D" #'dired-do-delete + "E" #'dired-do-open "G" #'dired-do-chgrp "H" #'dired-do-hardlink "I" #'dired-do-info @@ -2483,7 +2484,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." ["Display Image" image-dired-dired-display-image :help "Display sized image in a separate window"] ["Display Image Externally" image-dired-dired-display-external - :help "Display image in external viewer"])) + :help "Display image in external viewer"] + ["Display Externally" dired-do-open + :help "Display file in external viewer"])) (easy-menu-define dired-mode-regexp-menu dired-mode-map "Regexp menu for Dired mode." -- 2.39.5