是否可以告诉emacs在Windows上使用IE http代理设置? [英] Is it possible to tell emacs on Windows to use the IE http proxy settings?

查看:217
本文介绍了是否可以告诉emacs在Windows上使用IE http代理设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

另请参见: HTTP代理后面的Emacs


是否可以自动告诉emacs 使用IE使用的任何代理设置?



url.el包可以显式指定一个代理如下:

 (setq url-using-proxy t)
(setq url-proxy-services'((http。proxyserver:3128)))

当我更改IE代理设置时,是否有可能发生自动神奇的事情?

解决方案

是的,这是可能的。



基本思想是为URL函数定义before-advice,并将这些变量设置为适当的值。这需要从elisp中从Windows中检索IE代理设置。



w32注册表包执行此操作。



因此,在Windows上,您可以执行以下操作:

  eval-after-loadurl
'(progn
(require'w32-registry)
(defadvice url-retrieve(before
w32-set-proxy-dynamic
$ b在检索URL之前,查询IE代理设置,并使用它们。
(let((proxy(w32reg-get-ie-proxy-config)))
(setq url-using-proxy proxy
url-proxy-services proxy)))))


See also: Emacs behind HTTP proxy

Is it possible to tell emacs to automatically use whatever proxy settings are in use by IE?

The url.el package says I can explicitly specify a proxy like this:

(setq url-using-proxy t)
(setq url-proxy-services  '(("http" . "proxyserver:3128")))

Is it possible for this to happen sort of auto-magically, when I change the IE proxy settings?

解决方案

Yes, it's possible.

The basic idea is to define before-advice for the URL functions, and set those variables to appropriate values. This requires being able to retrieve the IE proxy settings from Windows, from within elisp.

The w32-registry package does this.

Therefore, on Windows, you can do this:

(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上使用IE http代理设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆