[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor bc6520b 002/140: Replace setenv with push on p
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor bc6520b 002/140: Replace setenv with push on process-environment |
Date: |
Fri, 6 Aug 2021 12:51:08 -0400 (EDT) |
branch: elpa/with-editor
commit bc6520b269b498855d472602e5102a6f401134d8
Author: Noam Postavsky <npostavs@users.sourceforge.net>
Commit: Noam Postavsky <npostavs@users.sourceforge.net>
Replace setenv with push on process-environment
Let-binding process-environment does not nessarily protect from changes
made by setenv, because setenv may destructively modify the list object.
---
with-editor.el | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/with-editor.el b/with-editor.el
index a9abedc..3ebde90 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -377,7 +377,8 @@ ENVVAR is provided then bind that environment variable
instead.
(process-environment process-environment))
(if (or (not with-editor-emacsclient-executable)
(file-remote-p default-directory))
- (setenv with-editor--envvar with-editor-sleeping-editor)
+ (push (concat with-editor--envvar "=" with-editor-sleeping-editor)
+ process-environment)
;; Make sure server-use-tcp's value is valid.
(unless (featurep 'make-network-process '(:family local))
(setq server-use-tcp t))
@@ -389,19 +390,22 @@ ENVVAR is provided then bind that environment variable
instead.
(server-force-delete server-name)))
(server-start))
;; Tell $EDITOR to use the Emacsclient.
- (setenv with-editor--envvar
- (concat (shell-quote-argument
with-editor-emacsclient-executable)
+ (push (concat with-editor--envvar "="
+ (shell-quote-argument with-editor-emacsclient-executable)
;; Tell the process where the server file is.
- (and (not server-use-tcp)
- (concat " --socket-name="
- (shell-quote-argument
- (expand-file-name server-name
- server-socket-dir))))))
+ (and (not server-use-tcp)
+ (concat " --socket-name="
+ (shell-quote-argument
+ (expand-file-name server-name
+ server-socket-dir)))))
+ process-environment)
(when server-use-tcp
- (setenv "EMACS_SERVER_FILE"
- (expand-file-name server-name server-auth-dir)))
+ (push (concat "EMACS_SERVER_FILE="
+ (expand-file-name server-name server-auth-dir))
+ process-environment))
;; As last resort fallback to the sleeping editor.
- (setenv "ALTERNATE_EDITOR" with-editor-sleeping-editor))
+ (push (concat "ALTERNATE_EDITOR=" with-editor-sleeping-editor)
+ process-environment))
,@body))
(defun with-editor-server-window ()
- [nongnu] branch elpa/with-editor created (now 5519b6a), Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor bc6520b 002/140: Replace setenv with push on process-environment,
Jonas Bernoulli <=
- [nongnu] elpa/with-editor 580f225 001/140: reincarnation release, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 17df9b9 003/140: add AUTHORS.md and COPYING, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor b3631b8 006/140: make: fix dir target, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor fda7801 005/140: Add one more remap for evil, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 19716e9 007/140: remove with-editor.info, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ecff6bb 019/140: with-editor-file-name-history-exclude: new variable, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 4929d43 015/140: release version 2.5.2, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 650e0ad 025/140: manual: include sub-minor part of version in subtitle, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7b6ac3a 026/140: base the Makefile on the same template used for other packages, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor d28d074 008/140: regenerate manual after updating org and ox-texinfo+, Jonas Bernoulli, 2021/08/06