Make `dired-do-open' work on more *nix systems

* lisp/dired-aux.el (dired-do-open): Make `dired-do-open' work
on more *nix systems (bug#73004).
This commit is contained in:
Manuel Giraud 2024-09-06 09:47:33 +02:00 committed by Juri Linkov
parent 6d507d586a
commit 5e377f4fcc

View file

@ -1469,21 +1469,20 @@ system is determined by `shell-command-guess-open'."
(when (and (memq system-type '(windows-nt)) (when (and (memq system-type '(windows-nt))
(equal command "start")) (equal command "start"))
(setq command "open")) (setq command "open"))
(when command (if command
(dolist (file files) (dolist (file files)
(cond (cond
((memq system-type '(gnu/linux)) ((memq system-type '(ms-dos))
(call-process command nil 0 nil file)) (shell-command (concat command " " (shell-quote-argument file))))
((memq system-type '(ms-dos)) ((memq system-type '(windows-nt))
(shell-command (concat command " " (shell-quote-argument file)))) (w32-shell-execute command (convert-standard-filename file)))
((memq system-type '(windows-nt)) ((memq system-type '(cygwin))
(w32-shell-execute command (convert-standard-filename file))) (call-process command nil nil nil file))
((memq system-type '(cygwin)) ((memq system-type '(darwin))
(call-process command nil nil nil file)) (start-process (concat command " " file) nil command file))
((memq system-type '(darwin)) (t
(start-process (concat command " " file) nil command file)) (call-process command nil 0 nil file))))
(t (error "Open not supported on this system"))))
(error "Open not supported on this system")))))))
;;; Commands that delete or redisplay part of the dired buffer ;;; Commands that delete or redisplay part of the dired buffer