[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor ac6b2e3 085/140: with-editor*: New macro
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor ac6b2e3 085/140: with-editor*: New macro |
Date: |
Fri, 6 Aug 2021 12:51:25 -0400 (EDT) |
branch: elpa/with-editor
commit ac6b2e3aa219a6e0073341665bee859f19627519
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
with-editor*: New macro
---
with-editor.el | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/with-editor.el b/with-editor.el
index 88c55ba..2f6fcca 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -448,7 +448,8 @@ or \\[with-editor-cancel] to cancel"))))))
"Use the Emacsclient as $EDITOR while evaluating BODY.
Modify the `process-environment' for processes started in BODY,
instructing them to use the Emacsclient as $EDITOR. If optional
-ENVVAR is provided then bind that environment variable instead.
+ENVVAR is a literal string then bind that environment variable
+instead.
\n(fn [ENVVAR] BODY...)"
(declare (indent defun) (debug (body)))
`(let ((with-editor--envvar ,(if (stringp (car body))
@@ -458,6 +459,19 @@ ENVVAR is provided then bind that environment variable
instead.
(with-editor--setup)
,@body))
+(defmacro with-editor* (envvar &rest body)
+ "Use the Emacsclient as the editor while evaluating BODY.
+Modify the `process-environment' for processes started in BODY,
+instructing them to use the Emacsclient as editor. ENVVAR is the
+environment variable that is exported to do so, it is evaluated
+at run-time.
+\n(fn [ENVVAR] BODY...)"
+ (declare (indent defun) (debug (body)))
+ `(let ((with-editor--envvar ,envvar)
+ (process-environment process-environment))
+ (with-editor--setup)
+ ,@body))
+
(defun with-editor--setup ()
(if (or (not with-editor-emacsclient-executable)
(file-remote-p default-directory))
- [nongnu] elpa/with-editor ba4ca8a 108/140: with-editor-finish: Fix bug concerning git-commit-post-finish-hook, (continued)
- [nongnu] elpa/with-editor ba4ca8a 108/140: with-editor-finish: Fix bug concerning git-commit-post-finish-hook, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 324285f 109/140: Add htmlxref.cnf, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 9097321 112/140: with-editor-export-editor: Fix for term-mode, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor d8f2e99 116/140: Fix typo, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f2a9b02 121/140: manual: Add indices, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7c51288 122/140: make-process--with-editor-process-filter: &allow-other-keys, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 236c158 127/140: Require subr-x for when-let, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 36e163c 132/140: manual: Reorder header properties a bit, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ebcbd3b 134/140: Use defvar-local instead of make-variable-buffer-local, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 48e1b2d 082/140: with-editor-shell-command-use-emacsclient: Fix last modified info, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ac6b2e3 085/140: with-editor*: New macro,
Jonas Bernoulli <=
- [nongnu] elpa/with-editor 53dcd4d 106/140: Fix typos, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 590ff0b 124/140: manual: Use a favicon in html export, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor a339d65 126/140: with-editor-export-editor: Support vterm, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 5b62e6e 138/140: AUTHORS.md: Update list of contributors, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f69daaf 084/140: with-editor-{finish, cancel}: Run post hooks in correct directory, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 76f238f 088/140: make: Remove leftover debug statement, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 23919ec 095/140: Release version 2.8.2, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor a16f5e8 101/140: with-editor-usage-message: New variable, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 45c29f9 103/140: Fix travis setup, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f17d129 073/140: Rename COPYING file to LICENSE, Jonas Bernoulli, 2021/08/06