branch: externals/buffer-env
commit 5f4e2258ffb7f8176fae1dc8d1a6c8e3ae0aab13
Author: Augusto Stoffel <[email protected]>
Commit: Augusto Stoffel <[email protected]>
Add buffer-env-reset
---
buffer-env.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/buffer-env.el b/buffer-env.el
index 1e2228f82c..b84bdac59f 100644
--- a/buffer-env.el
+++ b/buffer-env.el
@@ -35,7 +35,8 @@
;; direnv and it's not possible to use direnv-specific features in the
;; .envrc scripts. On the plus side, it's possible to configure the
;; package to support other environment setup methods, such as .env
-;; files or Python virtualenvs.
+;; files or Python virtualenvs. The package Readme includes some
+;; examples.
;; The usual way to activate this package is by including the
;; following in your init file:
@@ -162,5 +163,12 @@ When called interactively, ask for a FILE."
(buffer-name)
file)))
+;;;###autoload
+(defun buffer-env-reset ()
+ "Reset this buffer's process environment to the global values."
+ (interactive)
+ (kill-local-variable 'process-environment)
+ (kill-local-variable 'exec-path))
+
(provide 'buffer-env)
;;; buffer-env.el ends here