summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/with-editor.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/with-editor.el b/lisp/with-editor.el
index e0f78dd..853e608 100644
--- a/lisp/with-editor.el
+++ b/lisp/with-editor.el
@@ -117,9 +117,10 @@ please see https://github.com/magit/magit/wiki/Emacsclient."))))
(let* ((version-lst (cl-subseq (split-string emacs-version "\\.") 0 depth))
(version-reg (concat "^" (mapconcat #'identity version-lst "\\."))))
(or (locate-file
- (if (equal (downcase invocation-name) "remacs")
- "remacsclient"
- "emacsclient")
+ (cond ((equal (downcase invocation-name) "remacs")
+ "remacsclient")
+ ((bound-and-true-p emacsclient-program-name))
+ ("emacsclient"))
path
(cl-mapcan
(lambda (v) (cl-mapcar (lambda (e) (concat v e)) exec-suffixes))