Skip to content

Commit 607ab3d

Browse files
committed
convert path for wsl
1 parent a9eed8f commit 607ab3d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

chatu-common.el

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ Fill PATH with EMPTY string, if nonexist."
6363
((string-equal system-type "darwin")
6464
(start-process "" nil "open" "-a" executable path))
6565
((string-equal system-type "gnu/linux")
66-
(start-process "" nil executable path))
66+
;; special handling for WSL emacs invoke Windows draw.io.exe
67+
(start-process
68+
""
69+
nil executable
70+
(if (string= "exe"
71+
(file-name-extension executable))
72+
(string-trim
73+
(shell-command-to-string
74+
(format "wslpath -aw '%s'" (file-truename path))))
75+
path)))
6776
((string-equal system-type "cygwin")
6877
(start-process "" nil "xdg-open"
6978
executable path)))))

chatu-drawio.el

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,7 @@ KEYWORD-PLIST contains parameters from the chatu line."
102102
(interactive)
103103
(let* ((input-path (plist-get keyword-plist :input-path))
104104
(input-path (file-truename (chatu-common-with-extension input-path "drawio")))
105-
(drawio-path (shell-quote-argument (funcall chatu-drawio-executable-func)))
106-
;; special handling for WSL emacs invoke Windows draw.io.exe
107-
(input-path
108-
(if (string= "exe"
109-
(file-name-extension drawio-path))
110-
(string-trim
111-
(shell-command-to-string
112-
(format "wslpath -aw '%s'" (file-truename input-path))))
113-
input-path)))
105+
(drawio-path (shell-quote-argument (funcall chatu-drawio-executable-func))))
114106
(chatu-common-open-external drawio-path input-path chatu-drawio-empty)))
115107

116108
(provide 'chatu-drawio)

0 commit comments

Comments
 (0)