branch: elpa/with-editor
commit 241726118dee067a8d9880d53c6a781d580ba8a1
Author: Philipp Stephani <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    Guard against nonexistent default directory
    
    Fixes #34.
    
    Modified-by: Jonas Bernoulli <[email protected]>
---
 with-editor.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/with-editor.el b/with-editor.el
index af8fc25..83b4b92 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -139,8 +139,9 @@ please see 
https://github.com/magit/magit/wiki/Emacsclient.";))))
              (with-editor-locate-emacsclient-1 path (1- depth))))))
 
 (defun with-editor-emacsclient-version (exec)
-  (ignore-errors
-    (cadr (split-string (car (process-lines exec "--version"))))))
+  (let ((default-directory (file-name-directory exec)))
+    (ignore-errors
+      (cadr (split-string (car (process-lines exec "--version")))))))
 
 (defun with-editor-emacsclient-path ()
   (let ((path exec-path))

Reply via email to