[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0ebaf4e 09/13: Restrict enwc-auto-scan to status variable
From: |
Ian Dunn |
Subject: |
[elpa] master 0ebaf4e 09/13: Restrict enwc-auto-scan to status variable |
Date: |
Sat, 15 Apr 2017 16:02:45 -0400 (EDT) |
branch: master
commit 0ebaf4e24d9292eb71e1c71d2eed0a9a50a11231
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Restrict enwc-auto-scan to status variable
* enwc.el (enwc--auto-scan): Renamed from enwc-auto-scan.
(enwc-enable-auto-scan-on-startup): New defcustom.
(enwc--setup-auto-scan): Use it
---
enwc.el | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/enwc.el b/enwc.el
index e194494..433951f 100644
--- a/enwc.el
+++ b/enwc.el
@@ -83,12 +83,23 @@ The specific information can be set using
`enwc-mode-line-format'."
:group 'enwc
:type 'boolean)
-(defcustom enwc-auto-scan nil
- "Whether or not to have ENWC automatically scan.
+(defcustom enwc-enable-auto-scan-on-startup nil
+ "Whether to enable auto-scan during `enwc-setup'.
+
If non-nil, then ENWC will automatically scan for
-networks every `enwc-auto-scan-interval' seconds."
+networks every `enwc-auto-scan-interval' seconds.
+
+To enable auto-scan after startup, use `enwc-enable-auto-scan'."
:group 'enwc
- :type 'boolean)
+ :group 'boolean)
+
+(defvar enwc--auto-scan nil
+ "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'.")
(defcustom enwc-auto-scan-interval 20
"The interval between automatic scans.
@@ -408,21 +419,21 @@ This is initiated during setup, and runs once every
second."
(unless enwc-scan-timer
(setq enwc-scan-timer
(run-at-time t enwc-auto-scan-interval 'enwc-scan t)))
- (setq enwc-auto-scan t)
+ (setq enwc--auto-scan t)
(message "Auto-scan enabled"))
(defun enwc-disable-auto-scan ()
"Disable auto scanning."
(interactive)
(when enwc-scan-timer (cancel-timer enwc-scan-timer))
- (setq enwc-auto-scan nil)
+ (setq enwc--auto-scan nil)
(message "Auto scan disabled"))
(defun enwc-toggle-auto-scan ()
"Toggles automatic scanning.
This will use the current value of `enwc-auto-scan-interval'."
(interactive)
- (if enwc-auto-scan
+ (if enwc--auto-scan
(enwc-disable-auto-scan)
(enwc-enable-auto-scan)))
@@ -768,7 +779,7 @@ newly created buffer."
(enwc-enable-display-mode-line)))
(defun enwc--setup-auto-scan ()
- (when (and enwc-auto-scan
+ (when (and enwc-enable-auto-scan-on-startup
(> enwc-auto-scan-interval 0)
(not enwc-scan-timer))
(setq enwc-scan-timer
@@ -788,7 +799,8 @@ Load the default backend, forcing it if
If `enwc-display-mode-line' is non-nil, enable the mode line.
-If `enwc-auto-scan' is non-nil, start the auto-scan timer."
+If `enwc-enable-auto-scan-on-startup' is non-nil, start the
+auto-scan timer."
(cond
((and enwc--setup-done enwc-warn-if-already-setup)
(message "ENWC is already setup."))
- [elpa] master updated (c30e4e1 -> 2dad73c), Ian Dunn, 2017/04/15
- [elpa] master ed920db 02/13: Inform user if enwc-setup has already been called, Ian Dunn, 2017/04/15
- [elpa] master b9869fc 04/13: Demoted setup error to message, Ian Dunn, 2017/04/15
- [elpa] master a61d78e 03/13: Ask the user about saving network interfaces during `enwc-setup', Ian Dunn, 2017/04/15
- [elpa] master bf628ce 05/13: Remove sort column when switching between wired and wireless, Ian Dunn, 2017/04/15
- [elpa] master 0ebaf4e 09/13: Restrict enwc-auto-scan to status variable,
Ian Dunn <=
- [elpa] master 17d530d 10/13: Add type for enwc-enable-auto-scan-on-startup, Ian Dunn, 2017/04/15
- [elpa] master 886420d 06/13: Split enwc-setup contents into separate functions, Ian Dunn, 2017/04/15
- [elpa] master 8cc5c8f 08/13: Fixed bug in enwc-refresh-widths, Ian Dunn, 2017/04/15
- [elpa] master 9893d7f 12/13: Updated version to 2.0, Ian Dunn, 2017/04/15
- [elpa] master b7529b1 01/13: Fixed wired connection and interface., Ian Dunn, 2017/04/15
- [elpa] master 60d9d90 07/13: Added tests for interface selection, Ian Dunn, 2017/04/15
- [elpa] master 7f15c06 11/13: Various fixes and improvements, Ian Dunn, 2017/04/15
- [elpa] master 2dad73c 13/13: Merge commit '9893d7f17a2ee7f83587c305c256bd1300995125', Ian Dunn, 2017/04/15