;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\210\312\313!\210\314\315\316\317\320DD\321\322\323\310\303&\210\314\324\316\317\325DD\326\322\327\310\303&\210\314\330\316\317\331DD\332\322\333\310\303&\207" [require exec-path-from-shell custom-declare-group use-proxy nil "Use proxy globally or limited to single S-expression." :prefix "use-proxy-" :group comm exec-path-from-shell-copy-envs ("HTTP_PROXY" "HTTPS_PROXY" "NO_PROXY") custom-declare-variable use-proxy-http-proxy funcall function #[0 "\300\301!\206\302\207" [getenv "HTTP_PROXY" "proxy.not.set"] 2] "HTTP proxy in HOST:PORT format, default is the value of $HTTP_PROXY." :type (string) use-proxy-https-proxy #[0 "\300\301!\206 \300\302!\206 \303\207" [getenv "HTTPS_PROXY" "HTTP_PROXY" "proxy.not.set"] 2] "HTTPS proxy in HOST:PORT format.\nIf not set, it will first try to\nuse the value of $HTTPS_PROXY, and then $HTTP_PROXY" (string) use-proxy-no-proxy #[0 "\300\301!\206\302\207" [getenv "NO_PROXY" "^\\(localhost\\|10\\..*\\|192\\.168\\..*\\)"] 2] "Regular expression described hosts you don't want to access through a proxy.\nIf not set, it will first try to use the value of $NO_PROXY,\nand then\"^\\(localhost\\|10\\..*\\|192\\.168\\..*\\)\"" (string)] 8) (defvar use-proxy--available-protocols '("http" "https")) (byte-code "\300\301\302\303\304DD\305\306\307%\210\310\311\312\313#\207" [custom-declare-variable use-proxy-display-in-global-mode-string funcall function #[0 "\300\207" [t] 1] "If non-nil, proxy states will also be added into `global-mode-string'.\nIn which case even if you turn off minor mode list or work with `diminish',\nproxy states would still be visible in your mode line if you enable %M substitution." :type boolean add-to-list global-mode-string (:eval (when (and (bound-and-true-p use-proxy-mode) use-proxy-display-in-global-mode-string) (use-proxy--proxy-states))) APPEND] 6) #@38 Check if PROXY is valid. (fn PROXY) (defalias 'use-proxy--valid-proxy-p #[257 "\211;\205\301\302\303\304#)\266\203\207" [inhibit-changing-match-data "^\\([0-9a-zA-Z_-]+\\.\\)*[0-9a-zA-Z_-]+\\(:[0-9]+\\)?$" nil t string-match] 8 (#$ . 1984)]) #@139 Trim proxy ADDRESS from '://:' into ':'. Because the former may lead name resolving errors. (fn ADDRESS) (defalias 'use-proxy--trim-proxy-address #[257 "\211;\203 \300\301\302\"!@\207\207" [last split-string "//"] 5 (#$ . 2241)]) #@100 Get proxy setting by protocol. Argument PROTO protocol which you want to get proxy of. (fn PROTO) (defalias 'use-proxy--get-custom-proxy-var-by-proto #[257 "\211\235\203\301\302\303\304\"!J!\207\305\306\"\207" [use-proxy--available-protocols use-proxy--trim-proxy-address intern-soft format "use-proxy-%s-proxy" error "%s proxy is not supported yet"] 6 (#$ . 2513)]) (defalias 'use-proxy--proxy-states #[0 "\301\302\303\304\305\306\307\"\"\310\"\311\312\"\203\313\202\314#\207" [url-proxy-services format "[%s]%s" string-join mapcar car seq-filter #[257 "\211@\300\230?\205\f\301A!\207" ["no_proxy" use-proxy--valid-proxy-p] 3 "\n\n(fn X)"] "," assoc "no_proxy" "" "g"] 8]) (defalias 'use-proxy--modeline-string #[0 "\300\301\302 \"\207" [format " proxy%s" use-proxy--proxy-states] 3]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \207" [custom-declare-variable use-proxy-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Use-Proxy mode is enabled.\nSee the `use-proxy-mode' command\nfor a description of this minor mode." :set custom-set-minor-mode :initialize custom-initialize-default :type boolean :group use-proxy] 12) #@589 Toggle proxy mode. This is a minor mode. If called interactively, toggle the `Use-Proxy mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `(default-value 'use-proxy-mode)'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'use-proxy-mode #[256 "\302 \303\304\305=\203\306\304!?\202!\247\203 \307W\203 \310\202!\311\"\210\312\300!\2038\313\304\"\306\304!\2038\304B\314\315\306\304!\203D\316\202E\317\"\210\320\321!\203m\322\304!\210\302 \203]\211\302 \232\203m\323\324\306\304!\203i\325\202j\326\327#\210 \211\203\213\211@\330!\331!\204\203\332\333#\210\210A\266\202\202n\266\334 \210\306\304!\207" [global-minor-modes use-proxy--available-protocols current-message set-default use-proxy-mode toggle default-value 1 nil t boundp delq run-hooks use-proxy-mode-hook use-proxy-mode-on-hook use-proxy-mode-off-hook called-interactively-p any customize-mark-as-set message "Use-Proxy mode %sabled%s" "en" "dis" "" use-proxy--get-custom-proxy-var-by-proto use-proxy--valid-proxy-p warn "The value of `use-proxy-%s-proxy' is not a valid proxy. Got %s" force-mode-line-update] 9 (#$ . 3693) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar use-proxy-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\314\300!\205#\310\211%\207" [use-proxy-mode-map use-proxy-mode-hook variable-documentation put "Hook run after entering or leaving `use-proxy-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode use-proxy-mode (:eval (use-proxy--modeline-string)) boundp] 6) #@76 Toggle proxies globally by set/unset no_proxy key in `url-proxy-services'. (defalias 'use-proxy-toggle-proxies-global #[0 "\302\303 \"\203\304\303 \"\305\301 \"\210\306\307!\207\303B\211 \235\203% \266\202*\211 B\210\305\301 \"\210\306\310!\207" [use-proxy-no-proxy url-proxy-services assoc "no_proxy" assoc-delete-all customize-save-variable message "Global proxy mode on" "Global proxy mode off"] 4 (#$ . 5816) nil]) #@255 Toggle proxy on/off. You can toggle proxy per protocol, and proxy status will show on mode-line. This function will set/unset `url-proxy-services' to enable/disable proxies. Argument PROTO protocol which you want to enable/disable proxy for. (fn PROTO) (defalias 'use-proxy-toggle-proto-proxy #[257 "\211\203\211\202\302\303\304\305\306%\307!\310 \"\204C\311!\204%\312\313#\207B\211 \235\2034 \266\2029\211 B\210\314\301 \"\210\315\316\"\207\317 \"\314\301 \"\210\315\320\"\207" [use-proxy--available-protocols url-proxy-services completing-read "Toggle proxy for: " nil t "" use-proxy--get-custom-proxy-var-by-proto assoc use-proxy--valid-proxy-p warn "Invalid `use-proxy-%s-proxy' value %s" customize-save-variable message "%s proxy enabled" assoc-delete-all "%s proxy disabled"] 7 (#$ . 6251) "P"]) #@28 Toggle all proxies on/off. (defalias 'use-proxy-toggle-all-proxies #[0 "\203\303\211\207 \211\203 \211@\304!BB\210A\266\202\202 \210\305\nBB\211\207" [url-proxy-services use-proxy--available-protocols use-proxy-no-proxy nil use-proxy--get-custom-proxy-var-by-proto "no_proxy"] 5 (#$ . 7082) nil]) #@247 Use proxies on a group of S-expressions. This function respects `use-proxy--proxy' variables, and provide a local `url-proxy-services' to argument `BODY'. Argument PROTOS protocol list such as '("http" "https"). (fn PROTOS &rest BODY) (defalias 'use-proxy-with-custom-proxies '(macro . #[385 "\300\301\302\303EDCBB\207" [let url-proxy-services mapcar (lambda (proto) (cons proto (use-proxy--get-custom-proxy-var-by-proto proto)))] 7 (#$ . 7400)])) #@334 Use proxies on a group of S-expressions. This function doesn't respect custom `use-proxy--proxy' variables. It provides a local `url-proxy-services' to argument `BODY'. Argument PROTOS-ASSOC protocol association list in the form of '(("http" . "localhost:1234") ("https" . "localhost:2345")). (fn PROTOS-ASSOC &rest BODY) (defalias 'use-proxy-with-specified-proxies '(macro . #[385 "\300\301DCBB\207" [let url-proxy-services] 5 (#$ . 7868)])) (provide 'use-proxy)