From 10ecb9e75c5944d4b4a08e063f00736aa6345bfb Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sun, 27 Aug 2023 12:40:51 +0200 Subject: Use emacsclient-program-name if that is bound This should make it possible to use `with-editor' on Android. For Remacs continue to hardcode "remacsclient" because it has not been updated since this variable was introduced and is unlikely to be updated any time soon. --- lisp/with-editor.el | 7 ++++--- 1 file 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)) -- cgit v1.0