aboutsummaryrefslogtreecommitdiff
path: root/modules/slack-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
commit019057c7902ca0286b2ae9f0148f29bc53487dcd (patch)
treedb6ceb7ca1788240e97d8809607a93154519fc8b /modules/slack-config.el
parent2f2d8b1c4f4eae6707c472b2287c72c3bb796309 (diff)
downloaddotemacs-019057c7902ca0286b2ae9f0148f29bc53487dcd.tar.gz
dotemacs-019057c7902ca0286b2ae9f0148f29bc53487dcd.zip
fix(slack): friendly error on reaction command before slack loads
slack-current-buffer is declared but void until slack.el loads, so a cold C-; S ! signaled void-variable instead of the not-in-a-Slack-buffer message.
Diffstat (limited to 'modules/slack-config.el')
-rw-r--r--modules/slack-config.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/slack-config.el b/modules/slack-config.el
index 9eb9f838..e0ad5b75 100644
--- a/modules/slack-config.el
+++ b/modules/slack-config.el
@@ -197,7 +197,10 @@ so the Slack buffer stays usable."
"Add a reaction to the current Slack message using a curated shortlist.
Errors if called outside a Slack message buffer."
(interactive)
- (let ((buf (or slack-current-buffer
+ ;; boundp guard: the defvar above declares the var with no value, so it is
+ ;; void until slack.el loads -- a bare read on a cold call would signal
+ ;; void-variable instead of this friendly error.
+ (let ((buf (or (and (boundp 'slack-current-buffer) slack-current-buffer)
(user-error "Not in a Slack buffer"))))
(when-let* ((team (slack-buffer-team buf))
(reaction (cj/slack-select-reaction team)))