[PATCH] Fix $EDITOR with arguments
Romain Ouabdelkader
romain.ouabdelkader at gmail.com
Wed Jun 18 13:02:00 UTC 2025
Hello,
When using emacs in server mode with the package with-editor, $EDITOR
is set to "/path/to/emacsclient --socket-name=/path/to/socket".
This currently throw an error: "no such file or directory:
/path/to/emacsclient --socket-name=/path/to/socket"
We can use `eval "$EDITOR" $file` to support this format, see
https://github.com/magit/with-editor/blob/f32cd7b09d518b629bfaa3eeb92b539891c6b9bc/lisp/with-editor.el#L525
Sorry if this has been proposed before, I'm not sure how to search for
previous patch requests in the mailing list.
---
src/password-store.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/password-store.sh b/src/password-store.sh
index 22e818f..ac59c3e 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -500,7 +500,7 @@ cmd_edit() {
$GPG -d -o "$tmp_file" "${GPG_OPTS[@]}" "$passfile" || exit 1
action="Edit"
fi
- ${EDITOR:-vi} "$tmp_file"
+ eval "${EDITOR:-vi}" "$tmp_file"
[[ -f $tmp_file ]] || die "New password not saved."
$GPG -d -o - "${GPG_OPTS[@]}" "$passfile" 2>/dev/null | diff -
"$tmp_file" &>/dev/null && die "Password unchanged."
while ! $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile"
"${GPG_OPTS[@]}" "$tmp_file"; do
--
2.39.5 (Apple Git-154)
More information about the Password-Store
mailing list