;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\310\311\312\313\314\315\316\317&\210\320\321\322\323\316\311\324\325&\210\320\326\322\327\316\311\324\325&\210\320\330\331\332\316\311\324\333&\210\320\334\312\335\316\311\324\333&\207" [require enwc-backend tabulated-list cl-lib cl-macs format-spec map seq custom-declare-group enwc nil "*The Emacs Network Client" :prefix "enwc-" :group external custom-declare-variable enwc-wireless-device "" "The wireless device/interface to use for ENWC.\n\nIf this is unset when `enwc-setup' is called, the user will be\nprompted for an interface." :type string enwc-wired-device "The wired device/interface to use for ENWC.\n\nIf this is unset when `enwc-setup' is called, the user will be\nprompted for an interface." enwc-display-mode-line t "Non-nil means display network information in the mode line.\nThe specific information can be set using `enwc-mode-line-format'." boolean enwc-enable-auto-scan-on-startup "Whether to enable auto-scan during `enwc-setup'.\n\nIf non-nil, ENWC will automatically scan for networks every\n`enwc-auto-scan-interval' seconds.\n\nTo enable auto-scan after startup, use `enwc-enable-auto-scan'."] 8) #@153 Current state of auto-scan. To enable auto-scan, use `enwc-enable-auto-scan'. To enable auto-scan at startup, set `enwc-enable-auto-scan-on-startup'. (defvar enwc--auto-scan nil (#$ . 1645)) (byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\313&\210\300\314\315\316\304\305\306\317&\210\300\320\315\321\304\305\306\317&\207" [custom-declare-variable enwc-auto-scan-interval 20 "The interval between automatic scans.\n\nTo make any changes to this variable take effect outside of the\ncustomization interface, use `enwc-restart-auto-scan'." :group enwc :type integer enwc-mode-line-format " [%s%%] " "The format for displaying information in the mode line.\n\nThe following format specifiers display information about the\ncurrent wireless connection:\n\n%s = signal strength\n\n%e = essid\n\n%b = bssid\n\n%n = encryption type\n\n%c = channel\n\nWhen a wired connection is active, signal strength is 100, essid\nand bssid are \"Wired\", and encryption and channel are \"None\".\n\nThe following format specifiers are also significant:\n\n%% = A Normal '%'" string enwc-warn-if-already-setup t "Whether to warn the user if ENWC is already setup when calling `enwc-setup'." boolean enwc-ask-to-save-interfaces "Whether to ask about saving changes to the network interfaces during `enwc-setup'."] 8) #@96 The mode line display string. This is updated after every scan using `enwc-update-mode-line'. (defvar enwc-display-string " [0%] " (#$ . 2982)) #@50 Convert signal strength S to a string to dispay. (defalias 'enwc--print-strength #[(s) "\301\302\"\207" [s format "%s%%"] 3 (#$ . 3133)]) (defalias 'enwc--make-number-sorter '(macro . #[(n) "\301\302\303\304\305\306ED\307\305\310EDD\311BBE\207" [n lambda (a b) let act-a aref (nth 1 a) act-b (nth 1 b) ((< act-a act-b))] 8])) (defalias 'enwc--str-sorter #[(a b) "A@\304H A@\304H\211\nW*\207" [a b act-b act-a 0] 4]) (defalias 'enwc--chnl-sorter #[(a b) "A@\304H A@\304H\211\nW*\207" [a b act-b act-a 4] 4]) #@51 compiler-macro for inlining `enwc-column-spec-p'. (defalias 'enwc-column-spec-p--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block enwc-column-spec-p (and (memq (type-of cl-x) cl-struct-enwc-column-spec-tags) t)) nil] 7 (#$ . 3655)]) (put 'enwc-column-spec-p 'compiler-macro 'enwc-column-spec-p--cmacro) (defalias 'enwc-column-spec-p #[(cl-x) "\302! >\205 \303\207" [cl-x cl-struct-enwc-column-spec-tags type-of t] 2]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put enwc-column-spec-p side-effect-free error-free put enwc-column-spec cl-deftype-satisfies] 5) #@53 compiler-macro for inlining `enwc-column-spec-nil'. (defalias 'enwc-column-spec-nil--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block enwc-column-spec-nil (or (enwc-column-spec-p cl-x) (signal 'wrong-type-argument (list 'enwc-column-spec cl-x))) (aref cl-x 1)) nil] 7 (#$ . 4298)]) (put 'enwc-column-spec-nil 'compiler-macro 'enwc-column-spec-nil--cmacro) #@54 Access slot "nil" of `enwc-column-spec' struct CL-X. (defalias 'enwc-column-spec-nil #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-enwc-column-spec-tags type-of signal wrong-type-argument enwc-column-spec 1] 4 (#$ . 4718)]) (byte-code "\300\301\302\303#\300\207" [function-put enwc-column-spec-nil side-effect-free t] 4) #@56 compiler-macro for inlining `enwc-column-spec-detail'. (defalias 'enwc-column-spec-detail--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block enwc-column-spec-detail (or (enwc-column-spec-p cl-x) (signal 'wrong-type-argument (list 'enwc-column-spec cl-x))) (aref cl-x 2)) nil] 7 (#$ . 5071)]) (put 'enwc-column-spec-detail 'compiler-macro 'enwc-column-spec-detail--cmacro) #@57 Access slot "detail" of `enwc-column-spec' struct CL-X. (defalias 'enwc-column-spec-detail #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-enwc-column-spec-tags type-of signal wrong-type-argument enwc-column-spec 2] 4 (#$ . 5506)]) (byte-code "\300\301\302\303#\300\207" [function-put enwc-column-spec-detail side-effect-free t] 4) #@57 compiler-macro for inlining `enwc-column-spec-display'. (defalias 'enwc-column-spec-display--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block enwc-column-spec-display (or (enwc-column-spec-p cl-x) (signal 'wrong-type-argument (list 'enwc-column-spec cl-x))) (aref cl-x 3)) nil] 7 (#$ . 5868)]) (put 'enwc-column-spec-display 'compiler-macro 'enwc-column-spec-display--cmacro) #@58 Access slot "display" of `enwc-column-spec' struct CL-X. (defalias 'enwc-column-spec-display #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-enwc-column-spec-tags type-of signal wrong-type-argument enwc-column-spec 3] 4 (#$ . 6308)]) (byte-code "\300\301\302\303#\300\207" [function-put enwc-column-spec-display side-effect-free t] 4) #@56 compiler-macro for inlining `enwc-column-spec-sorter'. (defalias 'enwc-column-spec-sorter--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block enwc-column-spec-sorter (or (enwc-column-spec-p cl-x) (signal 'wrong-type-argument (list 'enwc-column-spec cl-x))) (aref cl-x 4)) nil] 7 (#$ . 6673)]) (put 'enwc-column-spec-sorter 'compiler-macro 'enwc-column-spec-sorter--cmacro) #@57 Access slot "sorter" of `enwc-column-spec' struct CL-X. (defalias 'enwc-column-spec-sorter #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-enwc-column-spec-tags type-of signal wrong-type-argument enwc-column-spec 4] 4 (#$ . 7108)]) (byte-code "\300\301\302\303#\300\207" [function-put enwc-column-spec-sorter side-effect-free t] 4) #@55 compiler-macro for inlining `enwc-column-spec-width'. (defalias 'enwc-column-spec-width--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block enwc-column-spec-width (or (enwc-column-spec-p cl-x) (signal 'wrong-type-argument (list 'enwc-column-spec cl-x))) (aref cl-x 5)) nil] 7 (#$ . 7470)]) (put 'enwc-column-spec-width 'compiler-macro 'enwc-column-spec-width--cmacro) #@56 Access slot "width" of `enwc-column-spec' struct CL-X. (defalias 'enwc-column-spec-width #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-enwc-column-spec-tags type-of signal wrong-type-argument enwc-column-spec 5] 4 (#$ . 7900)]) (byte-code "\300\301\302\303#\300\207" [function-put enwc-column-spec-width side-effect-free t] 4) #@54 compiler-macro for inlining `enwc-column-spec-conv'. (defalias 'enwc-column-spec-conv--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block enwc-column-spec-conv (or (enwc-column-spec-p cl-x) (signal 'wrong-type-argument (list 'enwc-column-spec cl-x))) (aref cl-x 6)) nil] 7 (#$ . 8259)]) (put 'enwc-column-spec-conv 'compiler-macro 'enwc-column-spec-conv--cmacro) #@55 Access slot "conv" of `enwc-column-spec' struct CL-X. (defalias 'enwc-column-spec-conv #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-enwc-column-spec-tags type-of signal wrong-type-argument enwc-column-spec 6] 4 (#$ . 8684)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put enwc-column-spec-conv side-effect-free t defalias copy-enwc-column-spec copy-sequence] 4) #@117 compiler-macro for inlining `make-enwc-column-spec'. (fn CL-WHOLE &cl-quote &key DETAIL DISPLAY SORTER WIDTH CONV) (defalias 'make-enwc-column-spec--cmacro #[(cl-whole &rest #1=#:--cl-rest--) "\306\307\"A@\306\310\"A@\306\311\"A@\306\312\"A@\306\313\"A@\203V@\314>\203=AA\211\202(\315>A@\203L\316\211\202(\317\320@\"\210\202&)\321\322\323\316\316 \n \f &\n-\207" [#1# detail display sorter width conv plist-member :detail :display :sorter :width :conv (:detail :display :sorter :width :conv :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:detail :display :sorter :width :conv)" cl--defsubst-expand (detail display sorter width conv) (cl-block make-enwc-column-spec (record 'enwc-column-spec nil detail display sorter width conv)) #2=#:--cl-keys-- cl-whole] 12 (#$ . 9096)]) (put 'make-enwc-column-spec 'compiler-macro 'make-enwc-column-spec--cmacro) #@97 Constructor for objects of type `enwc-column-spec'. (fn &key DETAIL DISPLAY SORTER WIDTH CONV) (defalias 'make-enwc-column-spec #[(&rest #1=#:--cl-rest--) "\306\307\"A@\306\310\"A@\306\311\"A@\306\312\"A@\306\313\"A@\203V@\314>\203=AA\211\202(\315>A@\203L\316\211\202(\317\320@\"\210\202&)\321\322\316 \n \f &-\207" [#1# detail display sorter width conv plist-member :detail :display :sorter :width :conv (:detail :display :sorter :width :conv :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:detail :display :sorter :width :conv)" record enwc-column-spec #2=#:--cl-keys--] 9 (#$ . 10020)]) (byte-code "\300\301\302\303#\304\305\306\307\310\306\311\312\305\303& \207" [function-put make-enwc-column-spec side-effect-free t cl-struct-define enwc-column-spec nil cl-structure-object record ((cl-tag-slot) (nil) (detail) (display) (sorter) (width) (conv)) cl-struct-enwc-column-spec-tags] 11) (defvar enwc-wireless-column-specs (byte-code "\300\301\302\303\304\305\302\306&\300\301\302\307\310\311\302\312&\300\301\302\313\314\311\302\312&\300\301\302\315\316\311\302\312&\300\301\302\317\320\321\302\322&\257\207" [record enwc-column-spec nil strength "Str" enwc--str-sorter enwc--print-strength essid "Essid" t identity encrypt "Encrypt" bssid "Bssid" channel "Channel" enwc--chnl-sorter number-to-string] 12)) (defvar enwc-wired-column-specs (byte-code "\300\301\302\303\304\305\302\306&C\207" [record enwc-column-spec nil name "Profile" t identity] 8)) #@157 Specifications for each column in the display. This should always be set to the value of either `enwc-wireless-column-specs' or `enwc-wired-column-specs'. (defvar enwc-column-specs enwc-wireless-column-specs (#$ . 11554)) #@411 The most recent scan results. This will be an association list of the form: ((ID . ((strength . STRENGTH) (essid . ESSID) ...)) ...) The form will be different when wired is enabled (see `enwc-using-wired'). This will have the form: ((ID . ((name . PROFILE-NAME))) ...) Each ID is a backend-specific network ID. Each key in the children association lists corresponds to an entry in `enwc-column-specs'. (defvar enwc--last-scan-results (make-hash-table :test 'equal) (#$ . 11784)) #@36 The most recent access point list. (defvar enwc-access-points nil (#$ . 12277)) #@165 Non-nil means ENWC is using wired connections. Note that this is NOT the same as `enwc-is-wired-p'. This variable indicates whether ENWC itself is in wired mode. (defvar enwc-using-wired nil (#$ . 12364)) #@53 This is the network id of the network being edited. (defvar enwc-edit-id nil (#$ . 12577)) #@112 This is non-nil when a scan has been requested. This is used so as to avoid multiple updates of the scan data. (defvar enwc-scan-requested nil (#$ . 12675)) #@88 This is non-nil that a scan was interactively requested. This is only used internally. (defvar enwc-scan-interactive nil (#$ . 12838)) #@35 The timer for automatic scanning. (defvar enwc-scan-timer nil (#$ . 12979)) (byte-code "\300\301!\210\302\303\304\305\306\307%\210\302\310\311\312\306\307%\207" [make-local-variable enwc-edit-id custom-declare-face enwc-header ((((class color) (background light)) (:foreground "Blue")) (((class color) (background dark)) (:foreground "Blue")) (t (:background "Blue"))) "The face for the headers." :group enwc enwc-connected ((((class color) (background dark)) (:foreground "Green")) (((class color) (background light)) (:foreground "Green")) (t (:background "Green"))) "The face for the connected network."] 6) #@65 Get the identifiers for the access points from a previous scan. (defalias 'enwc-get-networks #[nil "\302 \"\207" [enwc--current-backend enwc-using-wired enwc--network-ids] 3 (#$ . 13596)]) #@25 Request a backend scan. (defalias 'enwc-request-scan #[nil "\302\303 !\207" [enwc-scan-requested enwc--current-backend t enwc--scan] 2 (#$ . 13792)]) #@64 Connect to network with id ID. ID is specific to the backend. (defalias 'enwc-connect #[(id) "\303 \n#\207" [enwc--current-backend id enwc-using-wired enwc--connect] 4 (#$ . 13949)]) #@38 Disconnect from the current network. (defalias 'enwc-disconnect #[nil "\302 \"\207" [enwc--current-backend enwc-using-wired enwc--disconnect] 3 (#$ . 14140)]) #@111 Get the id of the current network id, or nil if there isn't one. The returned id is specific to the backend. (defalias 'enwc-get-current-nw-id #[nil "\302 \"\207" [enwc--current-backend enwc-using-wired enwc--current-nw-id] 3 (#$ . 14307)]) #@102 Check to see if there is a connection in progress. Returns `non-nil' if there is one, nil otherwise. (defalias 'enwc-check-connecting-p #[nil "\301!\207" [enwc--current-backend enwc--is-connecting-p] 2 (#$ . 14557)]) #@185 Get the network properties of the wireless network with id ID. This will return an associative list with the keys corresponding to `enwc-column-specs'. ID is specific to the backend. (defalias 'enwc-get-nw-props #[(id) "\303 \n#\207" [enwc--current-backend id enwc-using-wired enwc--nw-props] 4 (#$ . 14782)]) #@158 Check whether or not ENWC is connected to a wired network. Note that this is NOT the same as `enwc-using-wired'. This checks for an active wired connection. (defalias 'enwc-is-wired-p #[nil "\301!\207" [enwc--current-backend enwc--is-wired-p] 2 (#$ . 15101)]) (defalias 'enwc-connected-to-network-p #[nil "\300\301 !\207" [enwc-is-valid-nw-id-p enwc-get-current-nw-id] 2]) #@40 Confirm that ID is a valid network id. (defalias 'enwc-is-valid-nw-id-p #[(id) "\205\301=?\207" [id wired] 2 (#$ . 15481)]) #@235 Retrieve a value for DETAIL from `enwc--last-scan-results'. If ID is specified, then it will get the entry for ID. Otherwise, ID is set to the current network ID. If DETAIL is not found in `enwc--last-scan-results', then return nil. (defalias 'enwc-value-from-scan #[(detail &optional id) "\206\303  \205\304 \nD\"\207" [id enwc--last-scan-results detail enwc-get-current-nw-id map-nested-elt] 4 (#$ . 15616)]) #@57 Create a format specification for the mode line string. (defalias 'enwc-make-format-spec #[nil "\306 \307 \n?\310!?\311 \312\313 \203\314\2023\f\204# \203'\315\2023 \203/\316\2023\317\320\"\321 \203<\322\202P\f\204H \204H \203L\323\202P\317\324\"\325 \203Y\322\202m\f\204e \204e \203i\326\202m\317\327\"\330 \203v\323\202\212\f\204\202 \204\202 \203\206\323\202\212\317\331\"\332 \203\223\323\202\247\f\204\237 \204\237 \203\243\323\202\247\317\333\"\334\335&\f-\207" [cur-id wiredp enwc--last-scan-results no-last invalid-id connectingp enwc-get-current-nw-id enwc-is-wired-p enwc-is-valid-nw-id-p enwc-check-connecting-p format-spec-make 115 "100" "0" "*" enwc-value-from-scan strength 101 "Wired" "None" essid 98 "none" bssid 110 encrypt 99 channel 37 "%"] 13 (#$ . 16041)]) #@123 Format the mode line string. This is derived from `enwc-mode-line-format'. See the documentation for it for more details. (defalias 'enwc-format-mode-line-string #[nil "\301\302 \"\207" [enwc-mode-line-format format-spec enwc-make-format-spec] 3 (#$ . 16869)]) #@150 Update the mode line display. This uses the format specified by `enwc-mode-line-format'. This is initiated during setup, and runs once every second. (defalias 'enwc-update-mode-line #[nil "\205 \302 \303 \207" [enwc-display-mode-line enwc-display-string enwc-format-mode-line-string force-mode-line-update] 1 (#$ . 17138)]) #@31 Enable the mode line display. (defalias 'enwc-enable-display-mode-line #[nil "\204\302\303\304\235\204\305\306\"\307\310!\207" [global-mode-string enwc-display-mode-line ("") t enwc-display-string append (enwc-display-string) message "ENWC mode line enabled"] 3 (#$ . 17471) nil]) #@32 Disable the mode line display. (defalias 'enwc-disable-display-mode-line #[nil "\204\302\303\304\305\"\306\307!\207" [global-mode-string enwc-display-mode-line ("") nil remove enwc-display-string message "ENWC mode line disabled"] 3 (#$ . 17768) nil]) #@32 Toggles the mode line display. (defalias 'enwc-toggle-display-mode-line #[nil "\204\301 \207\302 \207" [enwc-display-mode-line enwc-enable-display-mode-line enwc-disable-display-mode-line] 1 (#$ . 18033) nil]) #@23 Enable auto scanning. (defalias 'enwc-enable-auto-scan #[nil "\247\203 \303W\203\304\305\"\207 \204\306\307\310\307$\307\304\311!\207" [enwc-auto-scan-interval enwc-scan-timer enwc--auto-scan 0 message "Unable to start ENWC auto-scan with invalid scan interval - Got %s, but need positive number" run-at-time t enwc-scan "Auto-scan enabled"] 5 (#$ . 18252) nil]) #@24 Disable auto scanning. (defalias 'enwc-disable-auto-scan #[nil "\203\302!\210\303\304\305!\207" [enwc-scan-timer enwc--auto-scan cancel-timer nil message "Auto scan disabled"] 2 (#$ . 18632) nil]) #@91 Toggles automatic scanning. This will use the current value of `enwc-auto-scan-interval'. (defalias 'enwc-toggle-auto-scan #[nil "\203\301 \207\302 \207" [enwc--auto-scan enwc-disable-auto-scan enwc-enable-auto-scan] 1 (#$ . 18840) nil]) #@29 Restart automatic scanning. (defalias 'enwc-restart-auto-scan #[nil "\300 \210\301 \207" [enwc-disable-auto-scan enwc-enable-auto-scan] 1 (#$ . 19087) nil]) #@201 The frontend of the scanning routine. Set up and move to the ENWC buffer if necessary, and scan and display the networks. If NODISP is `non-nil', then do not display the results in the ENWC buffer. (defalias 'enwc-scan #[(&optional nodisp) "\204 \302\303 \210r\304q\210\305 )\207" [nodisp enwc-scan-interactive t enwc-ensure-buffer "*ENWC*" enwc-scan-internal] 1 (#$ . 19251) nil]) #@321 The entry point for the internal scan routines. This checks whether or not wired is being used, and runs the appropriate function. If wireless is used, a scan is requested. All back-ends must call `enwc-process-scan' in some way upon completion of a wireless scan. A wired scan displays the available wired profiles. (defalias 'enwc-scan-internal #[nil "\203\302\303!\210 \203\304 \207\305 \207" [enwc-scan-interactive enwc-using-wired message "Scanning..." enwc-process-scan enwc-request-scan] 2 (#$ . 19645)]) (defalias 'enwc--update-scan-results #[nil "\303\304\305\"\306 \307\211\205!\n@\310 \311 !#\210\nA\211\204\307*\207" [enwc--last-scan-results ap --dolist-tail-- make-hash-table :test equal enwc-get-networks nil puthash enwc-get-nw-props] 5]) (defalias 'enwc-redisplay-networks #[nil "\301 \210\302!\210\303 \207" [enwc--last-scan-results enwc--update-scan-results enwc-display-networks enwc-update-mode-line] 2 nil nil]) #@162 The scanning callback. After a scan has been performed, this processes and displays the scan results. ARGS is only for compatibility with the calling function. (defalias 'enwc-process-scan #[(&rest args) "\205\302 \203\303\304!\210\305 \210\302\211\207" [enwc-scan-requested enwc-scan-interactive nil message "Scanning... Done" enwc-redisplay-networks] 2 (#$ . 20603)]) #@91 Refresh the column widths for display. (fn &optional (NETWORKS enwc--last-scan-results)) (defalias 'enwc-refresh-widths #[(&rest #1=#:--cl-rest--) "\203\f\211A\242\202 \203\304\305\306GTD\"\210\307\310 \"\211)\207" [#1# enwc--last-scan-results networks enwc-column-specs signal wrong-number-of-arguments enwc-refresh-widths mapcar #[(spec) "\306H\307H\310H\211\n \311!\203$\312\313\314\"!\202%\315 G\306\\\316!>\204=\317\320\321D\"\210\211\322]I\210. \207" [spec #2=#:x3745 #3=#:x3746 #4=#:x3747 detail display 2 3 6 mapp seq-max map-apply #[(id nw) "\303 \n\"!G\207" [conv detail nw alist-get] 4] 0 type-of signal wrong-type-argument enwc-column-spec 5 conv networks new-max min-width cl-struct-enwc-column-spec-tags #5=#:v] 5]] 4 (#$ . 20987)]) (defalias 'enwc--get-details #[(network-entry) "\301\302\"\207" [enwc-column-specs mapcar #[(detail) "\303\304! >\204\305\306\307D\"\210\310H\n\"\207" [detail cl-struct-enwc-column-spec-tags network-entry alist-get type-of signal wrong-type-argument enwc-column-spec 2] 5]] 3]) (defalias 'enwc--tabulated-list-entries #[nil "\301\302\"\207" [enwc--last-scan-results map-apply #[(id nw) "\302\303 !!D\207" [id nw vconcat enwc--get-details] 4]] 3]) #@42 Print the row ID with column values COL. (defalias 'enwc--tabulated-list-printer #[(id cols) "\303 \304 \305\306\307\n\"!\")\207" [cur-id id cols enwc-get-current-nw-id tabulated-list-print-entry vconcat seq-map-indexed #[(col idx) " 8\306\n! >\204\307\310\311\nD\"\210\n\312H\f!\232\203)\313 \314\315#\202* *\207" [idx enwc-column-specs detail cl-struct-enwc-column-spec-tags col conv type-of signal wrong-type-argument enwc-column-spec 6 propertize font-lock-face enwc-connected cur-id id] 4]] 6 (#$ . 22242)]) #@126 Displays the network in NETWORKS. This is an entry to the display functions, and checks whether or not ENWC is using wired. (defalias 'enwc-display-networks #[(networks) "\304 \210\305 \210r\306\307!q\210\310\311\312\"!\313\314\315 \210\316 )\207" [enwc-column-specs tabulated-list-format tabulated-list-entries tabulated-list-printer enwc-ensure-buffer enwc-refresh-widths get-buffer "*ENWC*" vconcat mapcar #[(#1=#:arg0) "\306H\307H\310H\211\n  \f  E.\207" [#1# #2=#:x3748 #3=#:x3749 #4=#:x3750 display width 3 5 4 sorter] 4] enwc--tabulated-list-entries enwc--tabulated-list-printer tabulated-list-init-header tabulated-list-print] 4 (#$ . 22774)]) #@300 Checks through NETWORKS for the network with essid ESSID, and returns the network identifier. Uses `enwc--last-scan-results' if NETWORKS is nil. If the network is not found, then it returns nil. When called interactively, this only prints out what it finds. Otherwise, it actually returns it. (defalias 'enwc-find-network #[(essid &optional networks) "\203\306\307!\210 \204\n\204\310\311 \210 \206\n\310\211\203A\f\204A\211A\242\312\313\f\243\" \230\204 \310\202 \f\203\\\314\315!\203W\316\317\320\f@! #\202e\f@\202e\314\315!\205e\316\321!+\207" [enwc-using-wired networks enwc--last-scan-results enwc-scan-interactive cur-net need-break error "Can't find wireless networks while on wired." nil enwc-scan-internal alist-get essid called-interactively-p any message "Network %d has essid %s" number-to-string "Network not found." nets] 4 (#$ . 23449) "sNetwork ESSID: "]) #@141 Connect to network with id ID. This is an entry point for the internal connection functions, and checks whether or not ENWC is using wired. (defalias 'enwc-connect-network #[(id) "\304!\210 \203\f\305\202 \306 \205\307\n\")\207" [id enwc-using-wired name-sym enwc--last-scan-results enwc-connect name essid enwc-value-from-scan] 3 (#$ . 24367)]) #@144 Connect the the network with network id NET-ID. Confirms that NET-ID is a valid network id. This calls `enwc-connect-network' as a subroutine. (defalias 'enwc-connect-to-network #[(net-id) "\302\303 !\204\f\304\305!\210\306 !\307\310\")\207" [cur-net net-id nil enwc-is-valid-nw-id-p error "Invalid network id." enwc-connect-network message "Connecting to %s"] 3 (#$ . 24727) "sNetwork ID: "]) #@42 Connect to the network with essid ESSID. (defalias 'enwc-connect-to-network-essid #[(essid) "\302!\211\203\303 !\202\304\305!)\207" [essid net-id enwc-find-network enwc-connect-to-network message "Network not found."] 3 (#$ . 25131) "sNetwork ESSID: "]) #@91 Connect to the network at the current line number. Moves to the enwc buffer if necessary. (defalias 'enwc-connect-to-network-at-point #[nil "\301=\204 \302 \210\303\304\305\206`\306\"\262!\207" [major-mode enwc-mode enwc-setup-buffer enwc-connect-to-network nil get-text-property tabulated-list-id] 5 (#$ . 25397) nil]) #@38 Disconnect from the network, if any. (defalias 'enwc-disconnect-network #[nil "\300\301!\210\302 \207" [message "Disconnecting" enwc-disconnect] 2 (#$ . 25729) nil]) (defalias 'enwc-enable-wired #[nil "\304 \305\211\207" [enwc-using-wired enwc-wired-column-specs enwc-column-specs tabulated-list-sort-key t nil] 2]) (defalias 'enwc-enable-wireless #[nil "\304 \304\211\207" [enwc-using-wired enwc-wireless-column-specs enwc-column-specs tabulated-list-sort-key nil] 2]) #@280 Toggle the display and mode between wireless and wired. This has the side-effect of setting the variable `enwc-using-wired', and calling a scan. In lisp code, calling `enwc-enable-wired' or `enwc-enable-wireless' will directly set the wired state, rather than just toggling it. (defalias 'enwc-toggle-wired #[nil "\303=\204 \304 \210\305\306 \210\n\203\307 \210\202\310 \210\311 )\207" [major-mode inhibit-read-only enwc-using-wired enwc-mode enwc-setup-buffer t erase-buffer enwc-enable-wireless enwc-enable-wired enwc-scan] 2 (#$ . 26212) nil]) #@411 Function to use to collect network interfaces. ENWC comes with two functions for this purpose: - enwc--ip-interface-list: Use ip to determine the network interfaces - enwc--ifconfig-interface-list: Use ifconfig to determine the network interfaces This must be a function of no arguments that returns a list of strings. Each element of the returned list should be a network interface, i.e. lo or eth0. (custom-declare-variable 'enwc-interface-list-function ''enwc--ip-interface-list '(#$ . 26774) :group 'enwc :type 'function) #@47 Use `ip' to get a list of network interfaces. (defalias 'enwc--ip-interface-list #[nil "\302\303\304!r q\210\305\216\306\307\302\310\302\311%\210eb\210\312\313\302\310#\203(\314\315!B\202+\237)\207" [interfaces #1=#:temp-buffer nil generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process "ip" t "link" re-search-forward "^[0-9]+: -*\\([[:alnum:]]+\\):" match-string 1] 6 (#$ . 27315)]) #@53 Use `ifconfig' to get a list of network interfaces. (defalias 'enwc--ifconfig-interface-list #[nil "\302\303\304!r q\210\305\216\306\307\302\310\302\311%\210eb\210\312\313\302\310#\203(\314\315!B\202+\237)\207" [interfaces #1=#:temp-buffer nil generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process "ifconfig" t "-a" re-search-forward "^\\([[:alnum:]]+\\):" match-string 1] 6 (#$ . 27766)]) #@289 Collect a list of network interfaces and prompt the user to select two. One interface will be used for wireless, and the other for wired. There is no need to call this function manually; that should be left to `enwc-setup'. Instead, set `enwc-wireless-device' and `enwc-wired-device'. (defalias 'enwc--select-interfaces #[nil " \306 \211\307\230\262\203\310\311\n\"\312\f\211\307\230\262\203%\310\313\n\"\312 \205< \205<\314\315!\205<\316\303 \"\210\316\304\f\"*\207" [enwc-interface-list-function changed interfaces enwc-wired-device enwc-wireless-device enwc-ask-to-save-interfaces nil "" completing-read "Wired Interface: " t "Wireless Interface: " y-or-n-p "Network Interfaces changed. Save for future sessions? " customize-save-variable] 3 (#$ . 28224)]) #@41 The keymap for network display in ENWC. (defvar enwc-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\314#\210)\207" [map make-sparse-keymap define-key "R" enwc-scan "C" enwc-connect-to-network-essid "D" enwc-disconnect-network "W" enwc-toggle-wired " " enwc-connect-to-network-at-point] 4) (#$ . 29009)) (defvar enwc-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [enwc-mode-hook variable-documentation put "Hook run after entering enwc mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp enwc-mode-map definition-name enwc-mode] 4) (defvar enwc-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [enwc-mode-abbrev-table enwc-mode-map variable-documentation put purecopy "Keymap for `enwc-mode'." boundp enwc-mode-syntax-table definition-name enwc-mode (lambda (#1=#:def-tmp-var) (defvar enwc-mode-syntax-table #1#)) make-syntax-table "Syntax table for `enwc-mode'." (lambda (#1#) (defvar enwc-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `enwc-mode'." derived-mode-parent tabulated-list-mode] 5) #@239 Mode for working with network connections. \{enwc-mode-map} In addition to any hooks its parent mode `tabulated-list-mode' might have run, this mode runs the hook `enwc-mode-hook', as the final or penultimate step during initialization. (defalias 'enwc-mode #[nil "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2036 \321 =\203<\322\f\323 \"\210)\324\325\"\204V =\204V\326\325 C#\210\327 !\210\330\f!\210 \331\332\333\334\307$\210)\335\336!\207" [delay-mode-hooks major-mode mode-name enwc-mode-map enwc-mode-syntax-table parent make-local-variable t tabulated-list-mode enwc-mode "enwc" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table add-hook tabulated-list-revert-hook enwc-redisplay-networks nil run-mode-hooks enwc-mode-hook enwc-mode-abbrev-table local-abbrev-table] 6 (#$ . 30500) nil]) #@171 Sets up the ENWC buffer. This first checks to see that it exists, and if it doesn't, then create it. If NOMOVE is non-nil, then do not move to the newly created buffer. (defalias 'enwc-setup-buffer #[(&optional nomove) "\301\302!\204r\303\302!q\210\304 \210)?\205\305\302!\207" [nomove get-buffer "*ENWC*" get-buffer-create enwc-mode switch-to-buffer] 2 (#$ . 31555)]) (defalias 'enwc-ensure-buffer #[nil "\300\301!?\205\n\302\303!\207" [get-buffer "*ENWC*" enwc-setup-buffer t] 2]) (defalias 'enwc--setup-select-interfaces #[nil "\211\302\230\262\204 \211\302\230\262\205\303 \207" [enwc-wired-device enwc-wireless-device "" enwc--select-interfaces] 3]) (defalias 'enwc--setup-load-default-backend #[nil "\301!\207" [enwc-force-backend-loading enwc-load-default-backend] 2]) (defalias 'enwc--setup-display-mode-line #[nil "\205\301 \207" [enwc-display-mode-line enwc-enable-display-mode-line] 1]) (defalias 'enwc--setup-auto-scan #[nil "\205\301 \207" [enwc-enable-auto-scan-on-startup enwc-enable-auto-scan] 1]) #@42 Non-nil if enwc has already been set up. (defvar enwc--setup-done nil (#$ . 32596)) #@352 Set up ENWC. If `enwc-wired-device' or `enwc-wireless-device' is empty, prompt the user to set them from a list of interfaces. Load the default backend, forcing it if `enwc-force-backend-loading' is non-nil. If `enwc-display-mode-line' is non-nil, enable the mode line. If `enwc-enable-auto-scan-on-startup' is non-nil, start the auto-scan timer. (defalias 'enwc-setup #[nil "\203\f \203\f\302\303!\207\203\304\207\305 \210\306 \210\307 \210\310 \210\304\211\207" [enwc--setup-done enwc-warn-if-already-setup message "ENWC is already setup." t enwc--setup-select-interfaces enwc--setup-load-default-backend enwc--setup-display-mode-line enwc--setup-auto-scan] 2 (#$ . 32687)]) #@157 The main front-end to ENWC. This sets up the buffer and scans for networks. In order to use this, one must have already run `enwc-setup'. \{enwc-mode-map} (defalias 'enwc #[nil "\300 \210\301 \210\302 \207" [enwc-setup enwc-setup-buffer enwc-scan] 1 (#$ . 33382) nil]) (provide 'enwc)