GNU bug report logs - #18132
Time for a smarter dired-guess-shell-alist-default? (dired-x.el)

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Howard Melman <hmelman <at> gmail.com>
To: 18132 <at> debbugs.gnu.org
Subject: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el)
Date: Sun, 24 Oct 2021 12:35:23 -0400
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.