From a5ee32ca29cc780d5f35af64930b3fb1835a85a2 Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Mon, 7 Jan 2019 20:01:52 -0500 Subject: More improvements for ERC --- jakob.org | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 6 deletions(-) (limited to 'jakob.org') diff --git a/jakob.org b/jakob.org index 4b5f09f..2349b57 100644 --- a/jakob.org +++ b/jakob.org @@ -280,7 +280,7 @@ Interactive function for automatically connecting to a local Bitlbee instance and all of the networks I have my bouncer connected to. #+BEGIN_SRC elisp -(defvar irc-autoconnect-networks '("bitlbee" "freenode" "tildetown" "tildechat") +(defvar irc-autoconnect-networks '("bitlbee" "crtnet" "freenode" "tildetown" "tildechat") "List of networks to automatically connect to when 'irc' is invoked.") (defun irc () @@ -295,11 +295,11 @@ and all of the networks I have my bouncer connected to. "Disconnects from and kills all buffers associated with ERC, and ends the Bitlbee process." (interactive) + (bitlbee-stop) (let ((server-buffers (remove-if-not #'erc-server-buffer-p (erc-buffer-list)))) (dolist (buffer server-buffers) (erc-with-buffer (buffer) - (erc-quit-server (funcall erc-quit-reason nil))))) - (bitlbee-stop)) + (erc-quit-server (funcall erc-quit-reason nil)))))) #+END_SRC Interactive functions for manipulating =erc-track-exclude=. @@ -381,6 +381,50 @@ Interactive function for switching to a channel's buffer. (switch-to-buffer channel))) #+END_SRC +Improvements upon manually switching channel buffers. Channels can now be cycled +through interactively. + +#+BEGIN_SRC elisp +(defun irc-cycle-buffer-list (starting-buffer) + "Returns the forward order in which to cycle channel buffers. +Channels with activity take priority in the order of +`erc-modified-channels-alist', followed by other channels in +alphabetical order." + (let* ((modified (map 'list + #'(lambda (channel) + (first channel)) + erc-modified-channels-alist)) + (rest (map 'list + #'(lambda (channel) + (get-buffer channel)) + (sort (remove-if #'(lambda (channel) + (member (get-buffer channel) modified)) + (list-irc-channels)) + #'(lambda (channel1 channel2) + (string< (subseq channel1 1) + (subseq channel2 1)))))) + (split-index (position (get-buffer starting-buffer) rest))) + (remove-if #'(lambda (buffer) (equal buffer (get-buffer starting-buffer))) + (if split-index + (concatenate 'list + modified + (subseq rest split-index) + (subseq rest 0 split-index)) + (concatenate 'list modified rest))))) + +(defun irc-cycle-forward () + "Visits the next channel buffer as dictated by +`irc-cycle-buffer-list'." + (interactive) + (switch-to-buffer (first (irc-cycle-buffer-list (current-buffer))))) + +(defun irc-cycle-backward () + "Visits the previous channel buffer as dictated by +`irc-cycle-buffer-list'." + (interactive) + (switch-to-buffer (car (last (irc-cycle-buffer-list (current-buffer)))))) +#+END_SRC + * Appearance ** Windowing @@ -1043,6 +1087,7 @@ available [[http://jakob.space/links/][on my website]] with links to the sites i ("https://this-week-in-rust.org/atom.xml" news) ("https://readrust.net/all/feed.rss" news) ("http://planet.lisp.org/rss20.xml" news) + ("https://ctftime.org/event/list/upcoming/rss/" news) ("https://xkcd.com/rss.xml" webcomic) ("https://www.foxtrot.com/feed/" webcomic) @@ -1153,7 +1198,6 @@ available [[http://jakob.space/links/][on my website]] with links to the sites i ("https://shadowrz.github.io/feed.xml" blog) ("https://blog.hcl.moe/feed" blog) ("https://blog.yoitsu.moe/feeds/all.atom.xml" blog) - ("https://leosongwei.github.io/rss.xml" blog) ("https://jfm.carcosa.net/blog/index.xml" blog) ("http://thestone.zone/feed.xml" blog) ("http://www.matrix67.com/blog/feed" blog) @@ -1340,7 +1384,15 @@ in [[IRC]]. (bind-key "C-c i i" #'ignore-channel) (bind-key "C-c i s" #'irc) (bind-key "C-c i q" #'irc-quit) - (bind-key "C-c i u" #'unignore-channel)) + (bind-key "C-c i u" #'unignore-channel) +#+END_SRC + +Binds that aren't part of a prefix map are fine, though. + +#+BEGIN_SRC elisp +:bind (:map erc-mode-map + ("C-c C-f" . irc-cycle-forward) + ("C-c C-b" . irc-cycle-backward))) #+END_SRC Ensure a package for colorizing nicks. @@ -1449,7 +1501,22 @@ Configuration for using the [[https://wiki.call-cc.org/emacs#builtin-scheme-supp #+BEGIN_SRC elisp (use-package xscheme :init - (setq scheme-program-name "csi -:c")) + (setq scheme-program-name "csi -:c") +#+END_SRC + +Redefinition of =xscheme-default-command-line= so that '-emacs' is not passed to +=csi=, since it doesn't recognize the argument and complains about it. + +#+BEGIN_SRC elisp + :config + (defun xscheme-default-command-line () + (concat scheme-program-name + (if scheme-program-arguments + (concat " " scheme-program-arguments) + "") + (if scheme-band-name + (concat " -band " scheme-band-name) + "")))) #+END_SRC * pdf-tools -- cgit v1.3