diff options
author | JSDurand <mmemmew@gmail.com> | 2021-05-20 18:40:57 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2021-05-20 18:40:57 +0800 |
commit | 2655155da480004b4bcb33e277d3ca68dd16c3f2 (patch) | |
tree | c3d0b7e417298865c8d5bc246283e323fc530a32 | |
parent | bb3b3229afdad13662342ead7c3440766c6a3f64 (diff) |
Refactor WIFI list command.
* wifi-bluetooth-conf.el (durand-wifi-list-ports): The default
behaviour should only list the currently connected WIFI port,
instead of listing every available port.
(durand-wifi-list-sentinel): The sentinel should report if WIFI is not
enabled.
-rw-r--r-- | wifi-bluetooth-conf.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wifi-bluetooth-conf.el b/wifi-bluetooth-conf.el index d02bb77..a32af96 100644 --- a/wifi-bluetooth-conf.el +++ b/wifi-bluetooth-conf.el @@ -139,13 +139,13 @@ If ARG is non-nil, then list the currently connected port." (make-process :name "durand-wifi-list-ports" :buffer durand-wifi-bluetooth-buffer - :command (list durand-wifi-executable "-s") + :command (list durand-wifi-executable "-I") :sentinel #'durand-wifi-list-sentinel)) ((make-process :name "durand-wifi-list-ports" :buffer durand-wifi-bluetooth-buffer - :command (list durand-wifi-executable "-I") - :sentinel #'durand-wifi-list-sentinel)))) + :command (list durand-wifi-executable "-s") + :sentinel #'durand-wifi-list-sentinel) ))) ;;;###autoload (defun durand-wifi-join-port (port &optional pwd) @@ -179,7 +179,9 @@ This only does something when STATUS is the string \"finished\\n\"." (cond ((string-equal status "finished\n") (with-current-buffer durand-wifi-bluetooth-buffer (goto-char (point-min)) - (cond ((re-search-forward "\\s-+SSID" (line-end-position) t) + (cond ((re-search-forward "AirPort: Off" nil t) + (message "Wifi is not enabled.")) + ((re-search-forward "\\s-+SSID" (line-end-position) t) (setq first-var t) (forward-line 1) (let ((start 0) list-of-ssids) |