From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73004: [PATCH] Make `dired-do-open' work on non GNU/Linux systems Date: Fri, 06 Sep 2024 09:50:22 +0200 Message-ID: <87ikv9usox.fsf@ledu-giraud.fr> References: <87le083m1s.fsf@ledu-giraud.fr> <877cbqjt03.fsf@posteo.net> <87h6auw6sj.fsf@ledu-giraud.fr> <86y1462o7u.fsf@gnu.org> <875xraw4l3.fsf@posteo.net> <86mskmuk75.fsf@mail.linkov.net> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25900"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73004@debbugs.gnu.org, Philip Kaludercic , Eli Zaretskii To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 06 09:51:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1smTkY-0006Vw-02 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Sep 2024 09:51:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smTkB-0006S0-3Z; Fri, 06 Sep 2024 03:50:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smTk8-0006IH-Gj for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2024 03:50:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smTk8-000252-7f for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2024 03:50:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Wzs24YClFI7CgJ/sQM+SUIh/Km5xQBFpJ/c6ZdGMwFA=; b=RCiXBxofv1oW1TOU+HRGI1JAOQ6iuZa7eeKITyJjN3bmWKFp19LQMb7Vdp430Awj+kRDDO6OA2i4d8powv3e/sxIMEML4dmY4WUrk7p7Chuxa6DwDuNbxPtFakdgRqphlBfOiwI2TfyLved+u9HY6HrmWPhaTrhMzy/Xh3NWpgNw4M61ShncAAWVBmsSky7rFe3kSt0qkTSdrlxEktvSJH+y9Z4ate8D82L+cIJh6RNHCm5RLwRcsbCYibchBOuXEH6ABzleoJECutS2aHecCS/l7WctOzT5hiI537XzT9biXTmnqK/cmH78hhDD4JFvHpzeNKic7iewsvKeCofSsA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smTlB-00085l-U6 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2024 03:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Sep 2024 07:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73004-submit@debbugs.gnu.org id=B73004.172560909531069 (code B ref 73004); Fri, 06 Sep 2024 07:52:01 +0000 Original-Received: (at 73004) by debbugs.gnu.org; 6 Sep 2024 07:51:35 +0000 Original-Received: from localhost ([127.0.0.1]:39055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smTkk-000852-Qu for submit@debbugs.gnu.org; Fri, 06 Sep 2024 03:51:35 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:13367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smTki-00084p-PV for 73004@debbugs.gnu.org; Fri, 06 Sep 2024 03:51:34 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=fWDnS+s0 brxLfTHYN0SNHmgYcw5YMDim7srGGpCu15k=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=iLF5fckzF15ReujsI6Ozm0nuqDRG0F LLHls/nrikNGu4YW3YOfjt7JYmsSL6dOoJ9eDTFHkwrJd/z0jpi9yFDA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=fWDnS+s0brxLfTHY N0SNHmgYcw5YMDim7srGGpCu15k=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=WShox5SBY+XRmElDRVq2C7yHt67HQ0hICctGzP aPdADlA4Of6NNDE9ZqufIvlRifUPLI9RnyYyp6+PNldGEx2UXJdRJrVyf/VYa77XQl3ifU S4Mp4Umm79tX0sUaTA0WAGl3moMjiQotfl0sH6knZGzsedjAb0Pygq6x5sLeWL21kgTine XUr6THjUwHWHAYD05ZcCVLuyHY969ovilr3Tfx8vWqoJkKPRj7HCJRT88jMejP+HSLCl09 cUVmuBpsj7Vhhc+k4fHIGZ2kJb5FkX228IXK2tgucIZxYEmEa8QRGgiaYp5oRbBYX+KaiN Ir5HQiiKGwgFEVfgxyCEeIvQ== Original-Received: from computer (2630.fr [82.65.148.221]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 73ea00dd (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 6 Sep 2024 09:50:24 +0200 (CEST) In-Reply-To: <86mskmuk75.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 05 Sep 2024 19:49:34 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291299 Archived-At: --=-=-= Content-Type: text/plain Juri Linkov 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-dired-do-open-work-on-more-nix-systems.patch >From d8e59996f8a8dccd564cb27e5a2a56f83cb2db6f Mon Sep 17 00:00:00 2001 From: Manuel Giraud 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")))) ;;; Commands that delete or redisplay part of the dired buffer -- 2.46.0 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--