From 7a6407eb92302f95e9cb2bc0cef035fc4b390d68 Mon Sep 17 00:00:00 2001 From: Mark Redeman Date: Sat, 23 Jun 2018 14:44:40 +0200 Subject: [PATCH] Add: reasonable default keybindings for circe The =+irc/send-message= function was added so that we can send private messages using =SPC m m= or =M-x= with =+irc/send-message=. --- modules/app/irc/autoload/irc.el | 6 ++++++ modules/app/irc/config.el | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/modules/app/irc/autoload/irc.el b/modules/app/irc/autoload/irc.el index 1e1f01210..a630fb61d 100644 --- a/modules/app/irc/autoload/irc.el +++ b/modules/app/irc/autoload/irc.el @@ -36,6 +36,12 @@ workspace for it." (and (+irc-setup-wconf inhibit-workspace) (call-interactively #'circe))) +;;;###autoload +(defun +irc/send-message (who what) + "Send WHO a message containing WHAT." + (interactive "sWho: \nsWhat: ") + (circe-command-MSG who what)) + ;;;###autoload (defun +irc/quit () "Kill current circe session and workgroup." diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index a32ecf355..f6d9b982e 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -125,7 +125,23 @@ playback.") (after! solaire-mode ;; 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 circe-mode-map + :desc "Next active buffer" :n "a" #'tracking-next-buffer + :desc "Join channel" :n "j" #'circe-command-JOIN + :desc "Send private message" :n "m" #'+irc/send-message + :desc "Part current channel" :n "p" #'circe-command-PART + :desc "Quit irc" :n "Q" #'+irc/quit + :desc "Reconnect" :n "R" #'circe-reconnect + + (:when (featurep! :completion ivy) + :desc "Jump to channel" :n "c" #'+irc/ivy-jump-to-channel)) + + (:map circe-channel-mode-map + :desc "Show names" :n "n" #'circe-command-NAMES))) (def-package! circe-color-nicks