Skip to content

Instantly share code, notes, and snippets.

@ivey
Created October 22, 2008 07:09
Show Gist options
  • Save ivey/18566 to your computer and use it in GitHub Desktop.
Save ivey/18566 to your computer and use it in GitHub Desktop.
(defun my-erc-joined-channels ()
"Return all the channels you're in as a list. This does not include queries."
(save-excursion
;; need to get out of ERC mode so we can have *all* channels returned
(set-buffer "*scratch*")
(mapcar #'(lambda (chanbuf)
(with-current-buffer chanbuf (erc-default-target)))
(erc-channel-list erc-process))))
(defun mark-channel (channel)
(save-excursion
(set-buffer (get-buffer-create channel))
(goto-char (point-max))
(forward-line -1)
(end-of-line)
(let ((inhibit-read-only t))
(insert "\n<<<<<<<< MARK >>>>>>>>")
(center-line))))
(defun mark-all-channels ()
(interactive)
(mapcar #'mark-channel (my-erc-joined-channels)))
(define-key erc-mode-map "\C-cm" 'mark-all-channels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment