branch: elpa/hyperdrive
commit 93fe2633fcf45838b705451a10937b28d68f1abc
Author: Joseph Turner <[email protected]>
Commit: Joseph Turner <[email protected]>
Change: Use h/gateway-installed-p instead of h//hyper-gateway-ushin-path
This change allows for a clearer level of abstraction. Also, there's
a small behavioral change: the h/menu gateway status indicator now
displays "upgrading" when the gateway is installed AND installing. If
the gateway is installing but not already installed, it displays
"installing", as before.
---
hyperdrive-lib.el | 8 ++++----
hyperdrive-menu.el | 22 ++++++----------------
hyperdrive.el | 3 +--
3 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 7b0ed796c0..b2c6549970 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1419,17 +1419,17 @@ Then calls THEN if given."
(defun h//gateway-start-default ()
"Start the gateway as an Emacs subprocess.
Default function; see variable `h/gateway-start-function'."
- (let ((hyper-gateway-ushin-path (h//hyper-gateway-ushin-path)))
+ (let ((hyper-gateway-ushin-path (h//hyper-gateway-ushin-path))
+ (gateway-installed-p (h/gateway-installed-p)))
(cond (h/gateway-process
;; Process variable is non-nil: gateway might be starting but not
yet
;; "live", which was checked in `h/start'. This probably should
never
;; happen, but if it were to, this distinct message might help us
;; understand what's going on.
(h/error "Gateway appears to be starting"))
- ((and (not hyper-gateway-ushin-path)
- hyperdrive-install-in-progress-p)
+ ((and (not gateway-installed-p) hyperdrive-install-in-progress-p)
(h/error "Gateway installation in-progress"))
- ((not hyper-gateway-ushin-path)
+ ((not gateway-installed-p)
(error "Hyperdrive: %s"
(substitute-command-keys
"Gateway not installed; try \\[hyperdrive-install]")))
diff --git a/hyperdrive-menu.el b/hyperdrive-menu.el
index 9df83858f2..16ec94150a 100644
--- a/hyperdrive-menu.el
+++ b/hyperdrive-menu.el
@@ -208,25 +208,15 @@
(propertize
(cond ((h//gateway-ready-p) "on")
((h/gateway-live-p) "starting")
- ((and (equal h/gateway-start-function
- (eval (car (get 'h/gateway-start-function
- 'standard-value))))
- h/install-in-progress-p)
- "installing")
- ((and (equal h/gateway-start-function
- (eval (car (get 'h/gateway-start-function
- 'standard-value))))
- (not (h//hyper-gateway-ushin-path)))
- "not found")
- (t "off"))
+ ((and (h/gateway-installed-p) h/install-in-progress-p)
+ "upgrading")
+ (h/install-in-progress-p "installing")
+ ((h/gateway-installed-p) "off")
+ (t "not found"))
'face 'transient-value)))
("G s" "Start" h/start
:transient t
- :inapt-if (lambda ()
- (and (equal h/gateway-start-function
- (eval (car (get 'h/gateway-start-function
- 'standard-value))))
- (not (h//hyper-gateway-ushin-path)))))
+ :inapt-if-not (lambda () (h/gateway-installed-p)))
("G S" "Stop" h/stop
:transient t
:inapt-if-not (lambda () (or (h/gateway-live-p) (h//gateway-ready-p))))
diff --git a/hyperdrive.el b/hyperdrive.el
index 7164762113..4f12a63867 100644
--- a/hyperdrive.el
+++ b/hyperdrive.el
@@ -1292,9 +1292,8 @@ If FORCEP, don't prompt for confirmation before
downloading."
(interactive (list current-prefix-arg))
(when h/install-in-progress-p
(h/error "Installation of gateway already in progress"))
- (declare-function h//hyper-gateway-ushin-path "hyperdrive-lib")
(unless forcep
- (when (h//hyper-gateway-ushin-path)
+ (when (h/gateway-installed-p)
(unless (yes-or-no-p "Download and reinstall/upgrade
hyper-gateway-ushin? ")
(user-error "Not downloading; aborted"))))
(let ((urls-and-hashes (alist-get system-type h/gateway-urls-and-hashes)))