summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Dunn <dunni@gnu.org>2017-10-07 12:13:21 -0400
committerIan Dunn <dunni@gnu.org>2017-10-07 12:13:21 -0400
commit7a42b7daf5e01be079db7e003f4ebebefbe228ac (patch)
tree1e586d3b85ed5983e43e296e7808e6df03c9d285
parent04eb8a564fa4e441a05f319584345ef69a503d89 (diff)
Use lexical binding and silence byte-compilerexternals/enwc
-rw-r--r--enwc-backend.el2
-rw-r--r--enwc-nm.el6
-rw-r--r--enwc-wicd.el2
-rw-r--r--enwc.el11
4 files changed, 12 insertions, 9 deletions
diff --git a/enwc-backend.el b/enwc-backend.el
index a8b8f92..b319dd8 100644
--- a/enwc-backend.el
+++ b/enwc-backend.el
@@ -1,4 +1,4 @@
-;;; enwc-backend.el --- Back-end functions for ENWC.
+;;; enwc-backend.el --- Back-end functions for ENWC. -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
diff --git a/enwc-nm.el b/enwc-nm.el
index 391f4ee..7ae1510 100644
--- a/enwc-nm.el
+++ b/enwc-nm.el
@@ -1,4 +1,4 @@
-;;; enwc-nm.el - The NetworkManager backend to ENWC
+;;; enwc-nm.el - The NetworkManager backend to ENWC -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
@@ -390,7 +390,7 @@ If STATE is 40, then NetworkManager is connecting to a new AP."
"The NetworkManager check connecting function."
enwc-nm-connecting-p)
-(defun enwc-nm-dev-prop-changed (new-state old-state reason)
+(defun enwc-nm-dev-prop-changed (new-state _old-state _reason)
(setq enwc-nm-wired-p (eq new-state 100)))
(defun enwc-nm-is-wired ()
@@ -405,7 +405,7 @@ If STATE is 40, then NetworkManager is connecting to a new AP."
(random t)
(apply 'format
"%04x%04x-%04x-%04x-%04x-%04x%04x%04x"
- (mapcar (lambda (x)
+ (mapcar (lambda (_x)
(random 65535))
(number-sequence 0 7))))
diff --git a/enwc-wicd.el b/enwc-wicd.el
index f0e157c..c7d32ca 100644
--- a/enwc-wicd.el
+++ b/enwc-wicd.el
@@ -1,4 +1,4 @@
-;;; enwc-wicd.el --- The Wicd backend to ENWC
+;;; enwc-wicd.el --- The Wicd backend to ENWC -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
diff --git a/enwc.el b/enwc.el
index 088f340..5bd01a5 100644
--- a/enwc.el
+++ b/enwc.el
@@ -1,4 +1,4 @@
-;;; enwc.el --- The Emacs Network Client
+;;; enwc.el --- The Emacs Network Client -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
@@ -61,6 +61,7 @@
(require 'map)
(require 'seq)
+(require 'subr-x)
(defgroup enwc nil
"*The Emacs Network Client"
@@ -493,7 +494,7 @@ A wired scan displays the available wired profiles."
(enwc-display-networks enwc--last-scan-results)
(enwc-update-mode-line))
-(defun enwc-process-scan (&rest args)
+(defun enwc-process-scan (&rest _args)
"The scanning callback.
After a scan has been performed, this processes and displays the scan results.
@@ -518,7 +519,7 @@ ARGS is only for compatibility with the calling function."
(new-max (if (mapp networks)
(seq-max
(map-apply
- (lambda (id nw)
+ (lambda (_id nw)
(length (funcall conv (alist-get detail nw))))
networks))
0))
@@ -560,6 +561,8 @@ This is an entry to the display functions, and checks whether or not ENWC is
(enwc-ensure-buffer)
;; Update the display widths.
(enwc-refresh-widths)
+ ;; Update the scan results
+ (setq enwc--last-scan-results networks)
(with-current-buffer (get-buffer "*ENWC*")
(setq tabulated-list-format
(vconcat
@@ -588,7 +591,7 @@ Otherwise, it actually returns it."
(setq enwc-scan-interactive nil)
(enwc-scan-internal))
(let ((nets (or networks enwc--last-scan-results))
- need-break cur-net)
+ cur-net)
(while (and nets (not cur-net))
(setq cur-net (pop nets))
(unless (string-equal (alist-get 'essid (cdr-safe cur-net))