Created
October 24, 2013 14:03
-
-
Save purcell/7137866 to your computer and use it in GitHub Desktop.
proxy-mode.el
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; proxy-mode.el --- Provides proxy minor mode. | |
;; 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 proxy minor mode. | |
;; URL: http://github.com/psachin/proxy-mode | |
;; Install | |
;; Using `package' | |
;; M-x package-install proxy-mode | |
;; Unless installed from a `package', add the directory containing | |
;; this file to `load-path', and then: | |
;; (require 'proxy-mode) | |
;; | |
;; To enable this mode globally: | |
;; | |
;; '(proxy-mode t) | |
;; Customize | |
;; M-x customize-group RET proxy-mode RET | |
;; | |
;; See ReadMe.org for more info. | |
;;; Code: | |
(require 'url) | |
(defgroup proxy-mode nil | |
"Provides proxy minor mode." | |
:group 'extensions | |
:link '(url-link :tag "Github" "https://github.com/psachin/proxy-mode")) | |
(defun proxy-enable () | |
"Enable proxy." | |
(kill-local-variable 'url-proxy-services)) | |
(defun proxy-disable () | |
"Disable proxy." | |
(set (make-local-variable 'url-proxy-services) nil)) | |
;;;###autoload | |
(define-minor-mode proxy-mode | |
"Minor proxy-mode." | |
:lighter nil ;; " ρ" | |
:global t | |
:group 'proxy | |
(if (not proxy-mode) | |
(proxy-disable) | |
(proxy-enable))) | |
(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