branch: master
commit 3d0e4a5b76ec9f5d621de4f2250901c04c50c1ca
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-locate-action-extern): Update on w32
Fixes #688
---
counsel.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/counsel.el b/counsel.el
index fda6d0e..dde66a0 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1444,15 +1444,16 @@ string - the full shell command to run."
(defun counsel-locate-action-extern (x)
"Use xdg-open shell command, or corresponding system command, on X."
(interactive (list (read-file-name "File: ")))
- (call-process shell-file-name nil
- nil nil
- shell-command-switch
- (format "%s %s"
- (cl-case system-type
- (darwin "open")
- (windows-nt "start")
- (t "xdg-open"))
- (shell-quote-argument x))))
+ (if (eq system-type 'windows-nt)
+ (w32-shell-execute "open" x)
+ (call-process shell-file-name nil
+ nil nil
+ shell-command-switch
+ (format "%s %s"
+ (cl-case system-type
+ (darwin "open")
+ (t "xdg-open"))
+ (shell-quote-argument x)))))
(defalias 'counsel-find-file-extern 'counsel-locate-action-extern)