emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/xah-fly-keys e514802f1b 1/3: fix xdg-open quits too early


From: ELPA Syncer
Subject: [nongnu] elpa/xah-fly-keys e514802f1b 1/3: fix xdg-open quits too early and kill external app
Date: Fri, 19 Aug 2022 17:59:18 -0400 (EDT)

branch: elpa/xah-fly-keys
commit e514802f1bcfc2459d1d06aef3be516173fd3e10
Author: emiltoacs <mil@evo.nomail>
Commit: emiltoacs <mil@evo.nomail>

    fix xdg-open quits too early and kill external app
    
    The linux branch of xah-open-in-external-app and xah-show-in-desktop that 
uses
    xdg-open starts another child process to open its parameters with the
    appropriate command then it quits however it makes emacs kill the 
subprocess as
    soon as xdg-open has finished therefore the files opened externally are also
    instantaneously killed.
---
 xah-fly-keys.el | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/xah-fly-keys.el b/xah-fly-keys.el
index 639c1b1a3d..610a634135 100644
--- a/xah-fly-keys.el
+++ b/xah-fly-keys.el
@@ -2680,11 +2680,11 @@ Version: 2020-11-20 2022-04-20"
       (shell-command
        (concat "open -R " (shell-quote-argument $path))))
      ((string-equal system-type "gnu/linux")
-      (let ((process-connection-type nil)
-            ($openFileProgram (if (file-exists-p "/usr/bin/gvfs-open")
-                                 "/usr/bin/gvfs-open"
-                               "/usr/bin/xdg-open")))
-        (start-process "" nil $openFileProgram (shell-quote-argument $path)))
+      (call-process shell-file-name nil nil nil
+                    shell-command-switch
+                    (format "%s %s"
+                            "xdg-open"
+                            (file-name-directory $path)))
       ;; (shell-command "xdg-open .") ;; 2013-02-10 this sometimes froze emacs 
till the folder is closed. eg with nautilus
       ))))
 
@@ -2729,7 +2729,13 @@ Version: 2019-11-04 2021-07-21"
        ((string-equal system-type "darwin")
         (mapc (lambda ($fpath) (shell-command (concat "open " 
(shell-quote-argument $fpath)))) $fileList))
        ((string-equal system-type "gnu/linux")
-        (mapc (lambda ($fpath) (let ((process-connection-type nil)) 
(start-process "" nil "xdg-open" $fpath))) $fileList))
+        (mapc (lambda ($fpath)
+                (call-process shell-file-name nil nil nil
+                              shell-command-switch
+                              (format "%s %s"
+                                      "xdg-open"
+                                      (shell-quote-argument $fpath))))
+              $fileList))
        ((string-equal system-type "berkeley-unix")
         (mapc (lambda ($fpath) (let ((process-connection-type nil)) 
(start-process "" nil "xdg-open" $fpath))) $fileList))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]