branch: elpa/with-editor
commit 99d3278b1c79718de16dd4f57dcc8c4aa31a4051
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
shell-command: enable with-editor-mode when appropriate
Because `emacsclient' only passed the environment along when
its `--create-frame' argument is used, we cannot tell whether
`with-editor' is involved, and therefore should not enable
`with-editor-mode'.
If we use the sleeping editor, then we know that `with-editor'
is involved, so always use that in our advice to `shell-command'.
Fixes #23.
---
with-editor.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/with-editor.el b/with-editor.el
index 6008c32..43a6a7a 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -688,9 +688,8 @@ else like the former."
(cond ((or (not (or with-editor--envvar shell-command-with-editor-mode))
(not (string-match-p "&\\'" command)))
(funcall fn command output-buffer error-buffer))
- ((and with-editor-emacsclient-executable
- (not (file-remote-p default-directory)))
- (with-editor (funcall fn command output-buffer error-buffer)))
+ ;; Do not use the `emacsclient', because it currently is not
+ ;; possible to know whether `with-editor' was involved. #23
(t
(apply fn (format "%s=%s %s"
(or with-editor--envvar "EDITOR")