See also: Emacs behind HTTP proxy
是否可以告诉 emacs 自动使用 IE 正在使用的任何代理设置?
url.el 包说我可以像这样明确指定一个代理:
(setq url-using-proxy t)
(setq url-proxy-services '(("http" . "proxyserver:3128")))
当我更改 IE 代理设置时,这是否有可能自动发生?
最佳答案
是的,这是可能的。
基本思想是为 URL 函数定义 before-advice,并将这些变量设置为适当的值。这需要能够从 elisp 中从 Windows 检索 IE 代理设置。
w32-registry package这样做。
因此,在 Windows 上,您可以这样做:
(eval-after-load "url"
'(progn
(require 'w32-registry)
(defadvice url-retrieve (before
w32-set-proxy-dynamically
activate)
"Before retrieving a URL, query the IE Proxy settings, and use them."
(let ((proxy (w32reg-get-ie-proxy-config)))
(setq url-using-proxy proxy
url-proxy-services proxy)))))
关于emacs - 是否可以告诉 Windows 上的 emacs 使用 IE http 代理设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10050186/