GNU bug report logs -
#18132
Time for a smarter dired-guess-shell-alist-default? (dired-x.el)
Previous Next
Reported by: Reuben Thomas <rrt <at> sc3d.org>
Date: Mon, 28 Jul 2014 18:27:01 UTC
Severity: wishlist
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #95 received at submit <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> 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
This bug report was last modified 363 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.