Skip to content

Instantly share code, notes, and snippets.

@purcell
Created October 25, 2013 09:23
Show Gist options
  • Save purcell/7151986 to your computer and use it in GitHub Desktop.
Save purcell/7151986 to your computer and use it in GitHub Desktop.
no-proxy-mode.el
;;; no-proxy-mode.el --- Temporarily disable built-in proxy settings
;; Copyright (C) 2013 by Sachin Patil
;; Author: Sachin Patil <[email protected]>
;; URL: http://github.com/psachin/proxy-mode
;; Keywords: network, proxy, tool, convenience
;; Version: 0.9
;; This file is NOT a part of GNU Emacs.
;; `proxy-mode' is free software distributed under the terms of
;; the GNU General Public License, version 3. For details, see the
;; file COPYING.
;;; Commentary:
;; Provides no-proxy minor mode.
;; URL: http://github.com/psachin/no-proxy-mode
;; Install
;; Using `package'
;; M-x package-install no-proxy-mode
;; Unless installed from a `package', add the directory containing
;; this file to `load-path', and then:
;; (require 'no-proxy-mode)
;;
;; To enable this mode globally:
;;
;; '(no-proxy-mode t)
;; See ReadMe.org for more info.
;;; Code:
(require 'url)
(defgroup no-proxy-mode nil
"Provides no-proxy minor mode."
:group 'extensions
:link '(url-link :tag "Github" "https://github.com/psachin/no-proxy-mode"))
;;;###autoload
(define-minor-mode no-proxy-mode
"Minor no-proxy-mode."
:lighter nil ;; " ρ"
:global t
:group 'proxy
(if no-proxy-mode
(set (make-local-variable 'url-proxy-services) nil)
(kill-local-variable 'url-proxy-services)))
(provide 'proxy-mode)
;;; proxy-mode.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment