[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/opam-switch-mode 0c2ecc2834 02/31: add reset, cleanup
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/opam-switch-mode 0c2ecc2834 02/31: add reset, cleanup |
Date: |
Mon, 14 Nov 2022 08:59:59 -0500 (EST) |
branch: elpa/opam-switch-mode
commit 0c2ecc2834a9c4802cb5170dcdf9eb70c7bfcad2
Author: Hendrik Tews <Hendrik.Tews@kernkonzept.com>
Commit: Hendrik Tews <Hendrik.Tews@kernkonzept.com>
add reset, cleanup
---
opam-mode.el | 34 +++++++---------------------------
1 file changed, 7 insertions(+), 27 deletions(-)
diff --git a/opam-mode.el b/opam-mode.el
index c8d1e8ba6b..d0474fb7e0 100644
--- a/opam-mode.el
+++ b/opam-mode.el
@@ -34,33 +34,6 @@
(apply 'opam-run-command-without-stderr sub-cmd switch sexp args)
(buffer-string)))
-(defun opam-run-command-with-stderr (err-buf sub-cmd &optional switch sexp
&rest args)
- "XXX"
- (let ((process-environment
- (append opam-common-environment process-environment))
- (options (append args opam-common-options))
- (temp-file (make-nearby-temp-file "emacs-opam-")))
- (when switch
- (push (format "--switch=%s" switch) options))
- (when sexp
- (push "--sexp" options))
- (apply 'process-file opam-program-name
- nil (list t temp-file) nil sub-cmd options)
- (with-current-buffer err-buf
- (insert-file-contents temp-file))
- (ignore-errors (delete-file temp-file))))
-
-;; (defun test (sub-cmd switch sexp)
-;; (let (err-buf stdout-string)
-;; (with-temp-buffer
-;; (setq err-buf (current-buffer))
-;; (with-temp-buffer
-;; (opam-run-command-with-stderr err-buf sub-cmd switch sexp)
-;; (setq stdout-string (buffer-string)))
-;; (cons stdout-string (buffer-string)))))
-
-
-
(defun opam-get-root ()
(let ((root (opam-command-as-string "var" nil nil "root")))
(when (eq (aref root (1- (length root))) ?\n)
@@ -127,6 +100,13 @@
(seq-remove (lambda (dir) (string-prefix-p opam-root dir))
exec-path))
(push new-bin-dir exec-path)))
+(defun opam-reset-env ()
+ "XXX"
+ (mapc (lambda (x) (setenv (car x) (cadr x))) opam-saved-env)
+ (setq exec-path opam-saved-exec-path)
+ (setq opam-saved-env nil)
+ (setq opam-saved-exec-path nil))
+
(defun opam-set-switch (switch-name)
"XXX"
- [nongnu] elpa/opam-switch-mode e681cbdcb7 29/31: chore: Update header and maintainer mailing list, (continued)
- [nongnu] elpa/opam-switch-mode e681cbdcb7 29/31: chore: Update header and maintainer mailing list, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode a83de84719 19/31: refactor: Replace `opsw--` with `opam-switch--`, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode 8a021ff128 12/31: rename to opam-switch-mode; use opsw as prefix for internals, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode df290bd0e3 21/31: Merge pull request #6 from ProofGeneral/prepare-melpa, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode eaf04b959d 25/31: fix: Improve error handling further (if opam can't be found), ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode 9d8aa6d5dc 08/31: display current switch in menu, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode 2c5ccd61f8 24/31: fix: Address review comments, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode d7ccecbf51 11/31: reset proof shell in Proof General via a hook function, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode 3a1c181d04 01/31: first version, can set but not reset, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode da49a0980b 03/31: license and minimal documentation, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode 0c2ecc2834 02/31: add reset, cleanup,
ELPA Syncer <=
- [nongnu] elpa/opam-switch-mode 4f05665f5c 22/31: fix: Add missing autoloads, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode 4334933613 28/31: docs(README.md): Add MELPA badge, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode 7c2118fb9e 20/31: docs(README.md): Add direct hyperlink to PG online doc, ELPA Syncer, 2022/11/14
- [nongnu] elpa/opam-switch-mode c8ca450330 06/31: hint on other shells; update README, ELPA Syncer, 2022/11/14