[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor 07bb67b 010/140: remove with-editor-export-edi
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor 07bb67b 010/140: remove with-editor-export-editor from hook for shell-command |
Date: |
Fri, 6 Aug 2021 12:51:10 -0400 (EDT) |
branch: elpa/with-editor
commit 07bb67b757a58da5a89e99cfc38bb449cd3edd6d
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
remove with-editor-export-editor from hook for shell-command
Fixes #6.
---
with-editor.el | 49 ++++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 21 deletions(-)
diff --git a/with-editor.el b/with-editor.el
index 459b1c8..4730af6 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -637,27 +637,34 @@ else like the former."
(defun shell-command--shell-command-with-editor-mode
(fn command &optional output-buffer error-buffer)
- (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)))
- (t
- (apply fn (format "%s=%s %s"
- (or with-editor--envvar "EDITOR")
- (shell-quote-argument with-editor-sleeping-editor)
- command)
- output-buffer error-buffer)
- (ignore-errors
- (let ((process (get-buffer-process
- (or output-buffer
- (get-buffer "*Async Shell Command*")))))
- (set-process-filter
- process (lambda (proc str)
- (comint-output-filter proc str)
- (with-editor-process-filter proc str t)))
- process)))))
+ ;; `shell-mode' and its hook are intended for buffers in which an
+ ;; interactive shell is running, but `shell-command' also turns on
+ ;; that mode, even though it only runs the shell to run a single
+ ;; command. The `with-editor-export-editor' hook function is only
+ ;; intended to be used in buffers in which an interactive shell is
+ ;; running, so it has to be remove here.
+ (let ((shell-mode-hook (remove 'with-editor-export-editor shell-mode-hook)))
+ (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)))
+ (t
+ (apply fn (format "%s=%s %s"
+ (or with-editor--envvar "EDITOR")
+ (shell-quote-argument with-editor-sleeping-editor)
+ command)
+ output-buffer error-buffer)
+ (ignore-errors
+ (let ((process (get-buffer-process
+ (or output-buffer
+ (get-buffer "*Async Shell Command*")))))
+ (set-process-filter
+ process (lambda (proc str)
+ (comint-output-filter proc str)
+ (with-editor-process-filter proc str t)))
+ process))))))
(advice-add 'shell-command :around
'shell-command--shell-command-with-editor-mode)
- [nongnu] elpa/with-editor c05420c 020/140: don't use pcase-dolist, not all supported Emacsen have it, (continued)
- [nongnu] elpa/with-editor c05420c 020/140: don't use pcase-dolist, not all supported Emacsen have it, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor de4022e 018/140: stop directing users to the issue tracker of magit, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ee41302 029/140: manual: minor improvements and typo fixes, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 2248a63 031/140: bump version, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor eb00831 033/140: with-editor-debug: add link to manual to doc-string, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 9fc0477 040/140: with-editor-output-filter: don't use tramp-make-tramp-file-name, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ae405e9 052/140: with-editor-export-editor: remove unnecessary leftovers, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 216ee34 056/140: Build on Travis, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor b37d94b 035/140: with-editor-debug: fix old reference to magit in output, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 706c8ce 011/140: instruct users to use term-exec-hook, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 07bb67b 010/140: remove with-editor-export-editor from hook for shell-command,
Jonas Bernoulli <=
- [nongnu] elpa/with-editor 6f41998 017/140: with-editor-export-editor: fix doc-string, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 0a8d9ce 039/140: manual: set version in Org source, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 1a6c49b 023/140: update list of contributors, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor b2d9d6b 024/140: stop using "BEGIN_EXPORT texinfo" to support Org v9.0, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 8ae3c7a 032/140: Add a space in before export command to avoid polluting HISTFILE, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ebf6ee4 034/140: with-editor-debug: don't run emacsclientw.exe, it makes popup windows, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 3385ffd 037/140: Revert "Use when-let instead of macros from dash", Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 229e80f 038/140: manual: regenerate using updated Org and Ox-Texinfo+, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 5851e76 043/140: Adapt to bug fixes in ox-texinfo and changes in ox-texinfo+ v2, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 5cddefa 044/140: Use remacsclient when using remacs, Jonas Bernoulli, 2021/08/06