]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve Dired context menu
authorEli Zaretskii <eliz@gnu.org>
Thu, 23 May 2024 18:14:13 +0000 (21:14 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 May 2024 20:36:36 +0000 (22:36 +0200)
* lisp/dired.el (dired-context-menu): Add 'w32-shell-execute' menu
item on MS-Windows.  Improve help-echo.

(cherry picked from commit e1789f66ac9ada9344fb22b2a191d61216f95459)

lisp/dired.el

index 28ec187e6664045712d4b092c2e1027f651a866d..21085de97f2fbcbb152016c578e19f49f01839de 100644 (file)
@@ -2642,7 +2642,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
            :help "Edit file at mouse click in other window"]
           ,@(when shell-command-guess-open
               '(["Open" dired-do-open
-                 :help "Open externally"]))
+                 :help "Open this file with the default application"]))
           ,@(when commands
               (list (cons "Open With"
                           (append
@@ -2653,7 +2653,13 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
                                          (interactive)
                                          (dired-do-async-shell-command
                                           ,command nil (list ,filename)))])
-                                   commands)))))))
+                                   commands)))))
+          ,@(when (eq system-type 'windows-nt)
+              `(["Select system app"
+                 (lambda ()
+                   (interactive)
+                   (w32-shell-execute "openas" ,filename))
+                 :help "Choose one of the apps available on your system"]))))
       (dolist (item (reverse (lookup-key easy-menu [menu-bar immediate])))
         (when (consp item)
           (define-key menu (vector (car item)) (cdr item))))))