From 6b456c1b7a4f6899f063a6e65355af51901d9c7a Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 9 Oct 2019 12:13:56 +0100 Subject: Massive configuration overhaul Currently paying the price of months of non-diligent git usage. Here's what has changed. - Theming support in Gvcci and wpgtk - Dropping support for i3 - Supporting EXWM - Many Elisp modules - Collapsed redundant directories in ./configs --- configs/shared/.emacs.d/wpc/irc.el | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 configs/shared/.emacs.d/wpc/irc.el (limited to 'configs/shared/.emacs.d/wpc/irc.el') diff --git a/configs/shared/.emacs.d/wpc/irc.el b/configs/shared/.emacs.d/wpc/irc.el new file mode 100644 index 000000000000..3dfaabdb397b --- /dev/null +++ b/configs/shared/.emacs.d/wpc/irc.el @@ -0,0 +1,79 @@ +;;; irc.el --- Configuration for IRC chat -*- lexical-binding: t -*- +;; Author: William Carroll + +;;; Commentary: +;; Need to decide which client I will use for IRC. + +;;; Code: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dependencies +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'erc) +(require 'cycle) +(require 'string) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Configuration +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(setq erc-rename-buffers t) + +(defvar irc/channels-cycle + (cycle/from-list + '("#omg" "#london" "#panic" "#prod-team")) + "List of channels through which I can cycle.") + +;; Setting `erc-join-buffer' to 'bury prevents erc from stealing focus of the +;; current buffer when it connects to IRC servers. +(setq erc-join-buffer 'bury) + +(setq erc-autojoin-channels-alist + `(("corp.google.com" . ,(cycle/to-list irc/channels-cycle)))) + +(defcustom irc/install-kbds? t + "When t, install the keybindings defined herein.") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Library +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun irc/message (x) + "Print message X in a structured way." + (message (string/format "[irc.el] %s" x))) + +(defun irc/connect-to-google () + "Connect to Google's Corp IRC using ERC." + (interactive) + (erc-ssl :server "irc.corp.google.com" + :port 6697 + :nick "wpcarro" + :full-name "William Carroll")) + +(defun irc/next-channel () + "Join the next channel in `irc/channels-cycle'." + (interactive) + (erc-join-channel + (cycle/next irc/channels-cycle)) + (irc/message + (string/format "Current IRC channel: %s" + (cycle/current irc/channels-cycle)))) + +(defun irc/prev-channel () + "Join the previous channel in `irc/channels-cycle'." + (interactive) + (erc-join-channel + (cycle/prev irc/channels-cycle)) + (irc/message + (string/format "Current IRC channel: %s" + (cycle/current irc/channels-cycle)))) + +(when irc/install-kbds? + (general-define-key + :keymaps 'erc-mode-map + "" #'irc/next-channel + "" #'irc/prev-channel)) + +(provide 'irc) +;;; irc.el ends here -- cgit 1.4.1