From bbc60f68ac190f02da8a100b6fb67cf1c27c53ab Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 10 Feb 2023 12:47:50 +0100 Subject: with-editor--setup: Replace leading "~" with home directory Otherwise it would get quoted, resulting in an invalid path. Even if that weren't the case, we still would have to expand "~", because git doesn't know what that means. --- lisp/with-editor.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/with-editor.el b/lisp/with-editor.el index c68720c..1dad118 100644 --- a/lisp/with-editor.el +++ b/lisp/with-editor.el @@ -514,7 +514,13 @@ at run-time. ;; Quoting is the right thing to do. Applications that ;; fail because of that, are the ones that need fixing, ;; e.g., by using 'eval "$EDITOR" file'. See #121. - (shell-quote-argument with-editor-emacsclient-executable) + (shell-quote-argument + ;; If users set the executable manually, they might + ;; begin the path with "~", which would get quoted. + (if (string-prefix-p "~" with-editor-emacsclient-executable) + (concat (expand-file-name "~") + (substring with-editor-emacsclient-executable 1)) + with-editor-emacsclient-executable)) ;; Tell the process where the server file is. (and (not server-use-tcp) (concat " --socket-name=" -- cgit v1.0