summaryrefslogtreecommitdiffstats
path: root/.emacs.d/lisp/bandali-misc.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/bandali-misc.el')
-rw-r--r--.emacs.d/lisp/bandali-misc.el80
1 files changed, 80 insertions, 0 deletions
diff --git a/.emacs.d/lisp/bandali-misc.el b/.emacs.d/lisp/bandali-misc.el
index eccee15..7a74888 100644
--- a/.emacs.d/lisp/bandali-misc.el
+++ b/.emacs.d/lisp/bandali-misc.el
@@ -125,5 +125,85 @@
(b/keymap-set m "C-x C-q" #'wgrep-change-to-wgrep-mode)
(b/keymap-set m "C-c C-c" #'wgrep-finish-edit)))
+(with-eval-after-load 'slack
+ (slack-register-team
+ :name "archive"
+ :token
+ (auth-source-pick-first-password
+ :host "iaslack" :user "bandalies")
+ :cookie
+ (auth-source-pick-first-password
+ :host "iaslack" :user "bandalies^cookie")
+ :default t
+ :subscribed-channels nil)
+ (slack-register-team
+ :name "archive-canada"
+ :token
+ (auth-source-pick-first-password
+ :host "iacslack" :user "bandalies")
+ :cookie
+ (auth-source-pick-first-password
+ :host "iacslack" :user "bandalies^cookie")
+ :subscribed-channels nil)
+ (setopt
+ slack-display-team-name nil
+ slack-prefer-current-team nil)
+ (b/keymap-global-set "C-c s l j" #'slack-select-rooms)
+ (b/keymap-global-set "C-c s l u" #'slack-select-unread-rooms)
+ (b/keymap-global-set "C-c s l U" #'slack-user-select)
+ (b/keymap-global-set "C-c s l E" #'slack-insert-emoji)
+ ;; (b/keymap-global-set "C-c s l E" #'emojify-insert-emoji)
+ (b/keymap-global-set "C-c s l i" #'slack-im-select)
+ (b/keymap-global-set "C-c s l e" #'slack-message-edit)
+ (b/keymap-global-set "C-c s l g" #'slack-message-redisplay)
+ (b/keymap-global-set "C-c s l r" #'slack-message-add-reaction)
+ (b/keymap-global-set "C-c s l t" #'slack-thread-show-or-create)
+ (b/keymap-global-set "C-c s l G" #'slack-conversations-list-update-quick)
+ (b/keymap-global-set "C-c s l q" #'slack-quote-and-reply)
+ (b/keymap-global-set "C-c s l Q" #'slack-quote-and-reply-with-link)
+ (let ((m slack-mode-map))
+ (b/keymap-set m "@" #'slack-message-embed-mention)
+ (b/keymap-set m "#" #'slack-message-embed-channel))
+ (let ((m slack-thread-message-buffer-mode-map))
+ (b/keymap-set m "C-c '" #'slack-message-write-another-buffer)
+ (b/keymap-set m "@" #'slack-message-embed-mention)
+ (b/keymap-set m "#" #'slack-message-embed-channel))
+ (let ((m slack-message-buffer-mode-map))
+ (b/keymap-set m "C-c '" #'slack-message-write-another-buffer)))
+(defvar b/slack-ws--reconnect-timer nil)
+(advice-add
+ 'slack-start
+ :before
+ (lambda (&rest _)
+ (unless b/slack-ws--reconnect-timer
+ (setq
+ b/slack-ws--reconnect-timer
+ (run-with-timer
+ 0 (* 25 60)
+ (lambda ()
+ (slack-ws--reconnect (oref slack-current-team :id) t)
+ ;; (slack-im-list-update)
+ ))))))
+(advice-add
+ 'slack-stop
+ :before
+ (lambda (&rest _)
+ (when b/slack-ws--reconnect-timer
+ (cancel-timer b/slack-ws--reconnect-timer)
+ (setq b/slack-ws--reconnect-timer nil))))
+(b/keymap-global-set "C-c s l s" #'slack-start)
+(b/keymap-global-set "C-c s l k" #'slack-stop)
+(add-hook 'slack-message-buffer-mode-hook #'emojify-mode)
+(add-hook 'slack-thread-message-buffer-mode-hook #'emojify-mode)
+(add-hook 'slack-message-buffer-mode-hook #'visual-line-mode)
+(add-hook 'slack-thread-message-buffer-mode-hook #'visual-line-mode)
+
+(with-eval-after-load 'alert
+ (setopt alert-default-style 'notifications))
+
+(with-eval-after-load 'emojify
+ (setopt
+ emojify-display-style 'unicode))
+
(provide 'bandali-misc)
;;; bandali-misc.el ends here