aboutsummaryrefslogtreecommitdiff
path: root/pearl.el
diff options
context:
space:
mode:
Diffstat (limited to 'pearl.el')
-rw-r--r--pearl.el23
1 files changed, 17 insertions, 6 deletions
diff --git a/pearl.el b/pearl.el
index 7214214..2ef4fae 100644
--- a/pearl.el
+++ b/pearl.el
@@ -5870,13 +5870,24 @@ resolves to a single label."
;;;###autoload
(defun pearl-check-setup ()
- "Check if Linear.el is properly set up."
+ "Check if Pearl is properly set up, then test the connection.
+Under accounts mode reports on the active account (resolving the default on
+first need) rather than the legacy `pearl-api-key' global, which is normally
+unset once `pearl-accounts' is configured."
(interactive)
- (if pearl-api-key
- (progn
- (message "API key is set (length: %d). Testing connection..." (length pearl-api-key))
- (pearl-test-connection))
- (message "Linear API key is not set. Use M-x customize-variable RET pearl-api-key")))
+ (if pearl-accounts
+ (condition-case err
+ (let ((ctx (pearl--current-account-context)))
+ (message "Account %s is set up (key resolved). Testing connection..."
+ (plist-get ctx :name))
+ (pearl-test-connection))
+ (error (message "Pearl accounts are configured but not usable: %s"
+ (error-message-string err))))
+ (if pearl-api-key
+ (progn
+ (message "API key is set (length: %d). Testing connection..." (length pearl-api-key))
+ (pearl-test-connection))
+ (message "Linear API key is not set. Use M-x customize-variable RET pearl-api-key"))))
;;;###autoload
(defun pearl-load-api-key-from-env ()