[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor 89280a6 133/140: with-editor-export-editor: Ch
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor 89280a6 133/140: with-editor-export-editor: Check whether there is a buffer process |
Date: |
Fri, 6 Aug 2021 12:51:35 -0400 (EDT) |
branch: elpa/with-editor
commit 89280a653f8cb6947d886f7cbd42de6d57838229
Author: Mario Rodas <marsam@users.noreply.github.com>
Commit: Jonas Bernoulli <jonas@bernoul.li>
with-editor-export-editor: Check whether there is a buffer process
When `with-editor-export-editor' is added to the `shell-mode-hook', it's
also executed by `shell-command', because it calls `shell-mode', which
inherits from `comint-mode'. Usually, `shell-command' is used to
execute short-lived process, hence there might not be a process
associated to the buffer when the hook is executed.
The previous implementation assumed the existence of a process
associated to a buffer, which might not be a case on `shell-command'
buffers. This change intends to checks whether there is a process
associated before sending the environment variables.
---
with-editor.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/with-editor.el b/with-editor.el
index 9950fff..ed1841c 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -697,7 +697,7 @@ This works in `shell-mode', `term-mode', `eshell-mode' and
(interactive (list (with-editor-read-envvar)))
(cond
((derived-mode-p 'comint-mode 'term-mode)
- (let ((process (get-buffer-process (current-buffer))))
+ (when-let ((process (get-buffer-process (current-buffer))))
(goto-char (process-mark process))
(process-send-string
process (format " export %s=%s\n" envvar
- [nongnu] elpa/with-editor 7ec873b 117/140: Release version 2.9.2, (continued)
- [nongnu] elpa/with-editor 7ec873b 117/140: Release version 2.9.2, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor d79c324 118/140: Add an advice for `make-process', Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 48ca9bb 119/140: Release version 2.9.3, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor c5e2141 120/140: manual: Fix location of LocalWords, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor efafd48 123/140: Release version 2.9.4, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor c4768f5 125/140: server-switch-buffer: Adjust advice for emacs 28, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 6735180 128/140: Suppress error if vterm module cannot be build, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor b439749 130/140: Remove async-bytecomp kludge, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 2848a90 131/140: license: Update URLs and cleanup whitespace, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 139ef39 129/140: Fix previous commit, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 89280a6 133/140: with-editor-export-editor: Check whether there is a buffer process,
Jonas Bernoulli <=
- [nongnu] elpa/with-editor 0708d14 135/140: Add SPDX-License-Identifier library header, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 86bdff6 136/140: Release version 3.0.3, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7b80d8e 137/140: make: Update path to ox-extra, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 2912073 139/140: Rearrange library header, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 5519b6a 140/140: Release version 3.0.4, Jonas Bernoulli, 2021/08/06