irc: add +irc/tracking-next-buffer
This way the user won't accidentally switch to the next unread buffer in the wrong workspacee and end up in a weird state.
This commit is contained in:
parent
ffc9e0f48e
commit
274d9a6c0c
3 changed files with 21 additions and 14 deletions
|
@ -44,8 +44,8 @@ custom keybinding.
|
||||||
When in a circe buffer these keybindings will be available.
|
When in a circe buffer these keybindings will be available.
|
||||||
|
|
||||||
| command | key | description |
|
| command | key | description |
|
||||||
|------------------------+-----------+----------------------------------------------|
|
|-----------------------------+-----------+----------------------------------------------|
|
||||||
| ~tracking-next-buffer~ | =SPC m a= | Switch to the next active buffer |
|
| ~+irc/tracking-next-buffer~ | =SPC m a= | Switch to the next active buffer |
|
||||||
| ~circe-command-JOIN~ | =SPC m j= | Join a channel |
|
| ~circe-command-JOIN~ | =SPC m j= | Join a channel |
|
||||||
| ~+irc/send-message~ | =SPC m m= | Send a private message |
|
| ~+irc/send-message~ | =SPC m m= | Send a private message |
|
||||||
| ~circe-command-NAMES~ | =SPC m n= | List the names of the current channel |
|
| ~circe-command-NAMES~ | =SPC m n= | List the names of the current channel |
|
||||||
|
|
|
@ -138,13 +138,19 @@ playback.")
|
||||||
(persp-remove-buffer buf persp))))
|
(persp-remove-buffer buf persp))))
|
||||||
(add-hook 'circe-mode-hook #'+irc|add-circe-buffer-to-persp)
|
(add-hook 'circe-mode-hook #'+irc|add-circe-buffer-to-persp)
|
||||||
|
|
||||||
|
(defun +irc/tracking-next-buffer ()
|
||||||
|
"Dissables switching to an unread buffer unless in the irc workspace."
|
||||||
|
(interactive)
|
||||||
|
(when (derived-mode-p 'circe-mode)
|
||||||
|
(tracking-next-buffer)))
|
||||||
|
|
||||||
(after! solaire-mode
|
(after! solaire-mode
|
||||||
;; distinguish chat/channel buffers from server buffers.
|
;; distinguish chat/channel buffers from server buffers.
|
||||||
(add-hook 'circe-chat-mode-hook #'solaire-mode))
|
(add-hook 'circe-chat-mode-hook #'solaire-mode))
|
||||||
|
|
||||||
(map! :localleader
|
(map! :localleader
|
||||||
(:map circe-mode-map
|
(:map circe-mode-map
|
||||||
"a" #'tracking-next-buffer
|
"a" #'+irc/tracking-next-buffer
|
||||||
"j" #'circe-command-JOIN
|
"j" #'circe-command-JOIN
|
||||||
"m" #'+irc/send-message
|
"m" #'+irc/send-message
|
||||||
"p" #'circe-command-PART
|
"p" #'circe-command-PART
|
||||||
|
|
|
@ -173,6 +173,7 @@
|
||||||
(:when (featurep! :app irc)
|
(:when (featurep! :app irc)
|
||||||
(:prefix ("I" . "irc")
|
(:prefix ("I" . "irc")
|
||||||
:desc "Open irc app" "i" #'=irc
|
:desc "Open irc app" "i" #'=irc
|
||||||
|
:desc "Next unread buffer" "a" #'+irc/tracking-next-buffer
|
||||||
:desc "Quit irc" "q" #'+irc/quit
|
:desc "Quit irc" "q" #'+irc/quit
|
||||||
:desc "Reconnect all" "r" #'circe-reconnect-all
|
:desc "Reconnect all" "r" #'circe-reconnect-all
|
||||||
:desc "Send message" "s" #'+irc/send-message
|
:desc "Send message" "s" #'+irc/send-message
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue