unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 73004@debbugs.gnu.org, Philip Kaludercic <philipk@posteo.net>,
	Eli Zaretskii <eliz@gnu.org>
Subject: bug#73004: [PATCH] Make `dired-do-open' work on non GNU/Linux systems
Date: Fri, 06 Sep 2024 09:50:22 +0200	[thread overview]
Message-ID: <87ikv9usox.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <86mskmuk75.fsf@mail.linkov.net> (Juri Linkov's message of "Thu,  05 Sep 2024 19:49:34 +0300")

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

Juri Linkov <juri@linkov.net> writes:

[...]

> The current implementation is based on long discussions including bug#18132.
> So everyone is welcome to improve it, it's not cast in stone.

Thanks for the pointer.  I'm proposing the following patch then.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-dired-do-open-work-on-more-nix-systems.patch --]
[-- Type: text/x-patch, Size: 2094 bytes --]

From d8e59996f8a8dccd564cb27e5a2a56f83cb2db6f Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
Date: Fri, 6 Sep 2024 09:47:33 +0200
Subject: [PATCH] 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.
---
 lisp/dired-aux.el | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index cd948bd7dd9..1d0e29b8782 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1469,21 +1469,20 @@ dired-do-open
     (when (and (memq system-type '(windows-nt))
                (equal command "start"))
       (setq command "open"))
-    (when command
-      (dolist (file files)
-        (cond
-         ((memq system-type '(gnu/linux))
-          (call-process command nil 0 nil file))
-         ((memq system-type '(ms-dos))
-          (shell-command (concat command " " (shell-quote-argument file))))
-         ((memq system-type '(windows-nt))
-          (w32-shell-execute command (convert-standard-filename file)))
-         ((memq system-type '(cygwin))
-          (call-process command nil nil nil file))
-         ((memq system-type '(darwin))
-          (start-process (concat command " " file) nil command file))
-         (t
-          (error "Open not supported on this system")))))))
+    (if command
+        (dolist (file files)
+          (cond
+           ((memq system-type '(ms-dos))
+            (shell-command (concat command " " (shell-quote-argument file))))
+           ((memq system-type '(windows-nt))
+            (w32-shell-execute command (convert-standard-filename file)))
+           ((memq system-type '(cygwin))
+            (call-process command nil nil nil file))
+           ((memq system-type '(darwin))
+            (start-process (concat command " " file) nil command file))
+           (t
+            (call-process command nil 0 nil file))))
+      (error "Open not supported on this system"))))
 
 \f
 ;;; Commands that delete or redisplay part of the dired buffer
-- 
2.46.0


[-- Attachment #3: Type: text/plain, Size: 18 bytes --]

-- 
Manuel Giraud

  reply	other threads:[~2024-09-06  7:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 13:26 bug#73004: [PATCH] Make `dired-do-open' work on non GNU/Linux systems Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 10:26 ` Philip Kaludercic
2024-09-05 13:48   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 14:02     ` Eli Zaretskii
2024-09-05 14:35       ` Philip Kaludercic
2024-09-05 16:49         ` Juri Linkov
2024-09-06  7:50           ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-09-14  7:48             ` Eli Zaretskii
2024-09-18 16:51               ` Juri Linkov
2024-09-19  3:52                 ` Howard Melman
2024-09-19  6:15                   ` Juri Linkov
2024-09-05 14:36       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikv9usox.fsf@ledu-giraud.fr \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73004@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=manuel@ledu-giraud.fr \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).