[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 43c98da 50/76: Changed enwc-last-scan to a hashtable.
From: |
Ian Dunn |
Subject: |
[elpa] master 43c98da 50/76: Changed enwc-last-scan to a hashtable. |
Date: |
Thu, 23 Feb 2017 19:42:52 -0500 (EST) |
branch: master
commit 43c98da102e22d45f101949c52eb3367dd12ad1d
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Changed enwc-last-scan to a hashtable.
* enwc.el (enwc-process-scan): Use 'map-into' to create the hash-table
(enwc-value-from-scan): Use `map-nested-elt' to get value.
Added map library as requirement.
---
lisp/enwc.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lisp/enwc.el b/lisp/enwc.el
index 540bc90..52bbce3 100644
--- a/lisp/enwc.el
+++ b/lisp/enwc.el
@@ -51,6 +51,7 @@
(require 'cl-lib)
(require 'cl-macs)
(require 'format-spec)
+(require 'map)
(defgroup enwc nil
"*The Emacs Network Client"
@@ -92,7 +93,7 @@ networks every `enwc-auto-scan-interval' seconds."
:group 'enwc
:type 'integer)
-(defcustom enwc-mode-line-format "[%s%%]"
+(defcustom enwc-mode-line-format " [%s%%] "
"The format for displaying the mode line.
%s = The current signal strength. If wired, then this is set to 100.
@@ -353,7 +354,7 @@ If DETAIL is not found in `enwc-last-scan', then return
nil."
(unless id
(setq id (enwc-get-current-nw-id)))
(when enwc-last-scan
- (alist-get detail (alist-get id enwc-last-scan))))
+ (map-nested-elt enwc-last-scan `(,id ,detail))))
(defun enwc-make-format-spec ()
"Create a format specification for the mode line string."
@@ -507,10 +508,12 @@ ARGS is only for compatibility with the calling function."
enwc-access-points (enwc-get-networks))
(when enwc-scan-interactive
(message "Scanning... Done"))
- (setq enwc-last-scan (mapcar
- (lambda (ap)
- `(,ap . ,(enwc-get-wireless-nw-props ap)))
- enwc-access-points))
+ (setq enwc-last-scan (map-into
+ (mapcar
+ (lambda (ap)
+ `(,ap . ,(enwc-get-wireless-nw-props ap)))
+ enwc-access-points)
+ 'hash-table))
(enwc-display-wireless-networks enwc-last-scan)
(setq enwc-scan-interactive nil)))
- [elpa] master 561f9e1 27/76: (enwc-wicd-get-profile-info, enwc-wicd-get-profile-sec-info): Improved docstring., (continued)
- [elpa] master 561f9e1 27/76: (enwc-wicd-get-profile-info, enwc-wicd-get-profile-sec-info): Improved docstring., Ian Dunn, 2017/02/23
- [elpa] master cb32122 13/76: (enwc-nm-prop-to-prop, enwc-wicd-prop-to-prop): Convert the properties used internally to the property names used externally., Ian Dunn, 2017/02/23
- [elpa] master d6bee52 32/76: (enwc-wicd.el): Fixed opening header., Ian Dunn, 2017/02/23
- [elpa] master 5088938 40/76: Removed erroneous comment., Ian Dunn, 2017/02/23
- [elpa] master 17f27c6 18/76: (enwc-nm-prop-to-prop, enwc-nm-get-sec-types): Removed., Ian Dunn, 2017/02/23
- [elpa] master ee90297 31/76: (enwc-nm.el): Fixed several docstrings, and file header., Ian Dunn, 2017/02/23
- [elpa] master 4e0d5a2 41/76: Cosmetic changes., Ian Dunn, 2017/02/23
- [elpa] master 8f21449 45/76: Removed tag 2.0, Ian Dunn, 2017/02/23
- [elpa] master ec0539b 42/76: Fixed enwc-setup to be able to be called more than once., Ian Dunn, 2017/02/23
- [elpa] master 5c63470 48/76: Fixed autoloads generation and added hgignore., Ian Dunn, 2017/02/23
- [elpa] master 43c98da 50/76: Changed enwc-last-scan to a hashtable.,
Ian Dunn <=
- [elpa] master c6585bb 47/76: Added autoloads, Ian Dunn, 2017/02/23
- [elpa] master 48e7aa4 55/76: Updated Makefile, Ian Dunn, 2017/02/23
- [elpa] master 2e07c3a 54/76: Began work on WPA backend. EXPERIMENTAL!, Ian Dunn, 2017/02/23
- [elpa] master ba6061b 51/76: Created more robust backend system., Ian Dunn, 2017/02/23
- [elpa] master ad38333 59/76: Cleaned up enwc-refresh-widths and changed enwc-details-list to enwc-column-specs., Ian Dunn, 2017/02/23
- [elpa] master a46fe3c 64/76: Don't switch to the ENWC buffer when processing a scan., Ian Dunn, 2017/02/23
- [elpa] master 33515f8 66/76: Silenced byte-compiler., Ian Dunn, 2017/02/23
- [elpa] master bcb33e6 30/76: (enwc-get-networks): Improved docstring., Ian Dunn, 2017/02/23
- [elpa] master 245a82f 52/76: Moved Wicd and NetworkManager backends to new system., Ian Dunn, 2017/02/23
- [elpa] master 3b1bbc6 69/76: Fixed autoloads target in Makefile, Ian Dunn, 2017/02/23