[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.
From: |
Howard Melman |
Subject: |
bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el) |
Date: |
Sun, 24 Oct 2021 12:35:23 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) |
Juri Linkov <juri@linkov.net> writes:
>> Such a command emulates what double clicking on an icon does
>> which most of the time is what a user wants (because it's
>> configured it do what their most common app need is).
>
> Such a command is long overdue. I used the following command
> for a long time, and forgot it's not in dired-x. I don't suggest
> to use this implementation, but something like this.
FWIW, my version is quite different:
#+begin_src emacs-lisp
;;; open a file as if double clicking on its icon
(declare-function w32-shell-execute "w32fns.c")
(defun hrm-open-file (file)
"Open FILE as the system would."
(interactive "fFile: ")
(cond ((memq system-type '(darwin))
(call-process-shell-command (concat "open " (shell-quote-argument
file))))
((memq system-type '(windows-nt))
(w32-shell-execute "open" (convert-standard-filename file)))
((memq system-type '(gnu/linux))
(call-process-shell-command (concat "xdg-open " (shell-quote-argument
file))))
(t
(error "Open not supported on this system"))))
(defun dired-do-open (&optional arg)
"Open the marked (or next ARG) files as the system would."
(interactive "P")
(mapc #'hrm-open-file (dired-get-marked-files nil arg)))
#+end_src
--
Howard
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), (continued)
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Stefan Kangas, 2021/10/23
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Reuben Thomas, 2021/10/23
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Stefan Kangas, 2021/10/23
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Gregory Heytings, 2021/10/23
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Reuben Thomas, 2021/10/23
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Eli Zaretskii, 2021/10/24
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Juri Linkov, 2021/10/24
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Howard Melman, 2021/10/23
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Juri Linkov, 2021/10/23
- bug#18132: [External] : bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Drew Adams, 2021/10/23
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el),
Howard Melman <=
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Juri Linkov, 2021/10/24
- bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el), Thierry Volpiatto, 2021/10/24