Skip to content

Commit

Permalink
fix(core): fix implementation of +with-proxies and +with-no-proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed May 16, 2024
1 parent 51eaafb commit 2e5d123
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/me-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -1803,21 +1803,21 @@ it forget them only when we are sure they don't exist."
(defun minemacs-disable-proxy ()
"Unset *_proxy Linux environment variables."
(interactive)
(minemacs-set-enabled-proxies (mapcar (lambda (a) (list (car a))) minemacs-proxies)))
(minemacs-set-enabled-proxies (mapcar (lambda (a) (list (car a))) (minemacs-get-enabled-proxies))))

(defmacro +with-proxies (&rest body)
"Execute BODY with proxies enabled from `minemacs-proxies'."
`(progn
(minemacs-enable-proxy minemacs-proxies)
,@body
(minemacs-disable-proxy)))
`(let ((old-proxies (minemacs-get-enabled-proxies)))
(minemacs-enable-proxy minemacs-proxies)
,@body
(minemacs-enable-proxy old-proxies)))

(defmacro +with-no-proxies (&rest body)
"Execute BODY with proxies disabled."
`(let ((old-proxies (minemacs-get-enabled-proxies)))
(minemacs-enable-proxy minemacs-proxies)
(minemacs-disable-proxy)
,@body
(minemacs-disable-proxy)))
(minemacs-enable-proxy old-proxies)))



Expand Down

0 comments on commit 2e5d123

Please sign in to comment.