diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2017-10-02 16:01:34 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2017-10-02 16:01:34 +0200 |
| commit | 99d3278b1c79718de16dd4f57dcc8c4aa31a4051 (patch) | |
| tree | 72f2c368c206f7ea9fe4559d649d868e859d9385 | |
| parent | fb9e56082b50f15e5179238df3760d4e670f38af (diff) | |
shell-command: enable with-editor-mode when appropriatev2.7.0
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.
| -rw-r--r-- | with-editor.el | 5 |
1 files 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") |
