[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ed920db 02/13: Inform user if enwc-setup has already been
From: |
Ian Dunn |
Subject: |
[elpa] master ed920db 02/13: Inform user if enwc-setup has already been called |
Date: |
Sat, 15 Apr 2017 16:02:43 -0400 (EDT) |
branch: master
commit ed920dbcd108444121b21edb12104be229750581
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Inform user if enwc-setup has already been called
* enwc.el (enwc-warn-if-already-setup): New defcustom.
(enwc-setup): Use it, and throw an error if enwc--setup-done is non-nil.
---
enwc.el | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/enwc.el b/enwc.el
index 6ed962e..ce98cd4 100644
--- a/enwc.el
+++ b/enwc.el
@@ -117,6 +117,11 @@ connection.
:group 'enwc
:type 'string)
+(defcustom enwc-warn-if-already-setup t
+ "Whether to warn the user if ENWC is already setup when calling
`enwc-setup'."
+ :group 'enwc
+ :type 'boolean)
+
(defvar enwc-display-string " [0%] "
"The mode line display string.
This is altered every second to display the current network strength
@@ -744,7 +749,11 @@ 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."
- (unless enwc--setup-done
+ (cond
+ ((and enwc--setup-done enwc-warn-if-already-setup)
+ (user-error "ENWC is already setup."))
+ (enwc--setup-done t)
+ (t
(when (or (string-empty-p enwc-wired-device)
(string-empty-p enwc-wireless-device))
(enwc--select-interfaces))
@@ -760,7 +769,7 @@ If `enwc-auto-scan' is non-nil, start the auto-scan timer."
(setq enwc-scan-timer
(run-at-time t enwc-auto-scan-interval 'enwc-scan t)))
- (setq enwc--setup-done t)))
+ (setq enwc--setup-done t))))
;;;###autoload
(defun enwc ()
- [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 <=
- [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, 2017/04/15
- [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