Skip to content

Synergy with other Emacs packages

Jakub Kadlčík edited this page May 31, 2020 · 1 revision

Midnight mode

Midnight mode runs a configured set of actions every midnight. By default it closes every buffer that hasn't been visited in the last 3 days.

To prevent killing circe buffers, put this into your configuration file.

(defun my/buffer-is-circe-p (buffer-name)
  (with-current-buffer buffer-name
    (derived-mode-p 'lui-mode)))

(add-to-list 'clean-buffer-list-kill-never-regexps 'my/buffer-is-circe-p)

Helm interface for switching channels

It may be useful to have buffer list already narrowed to only circe buffers.

(setq my/circe-buffers-source
  (helm-make-source "Circe Buffers" 'helm-source-buffers
    :buffer-list
    (lambda ()
      (mapcar #'buffer-name
              (cl-remove-if-not
              (lambda (buf)
                (with-current-buffer buf
                  (derived-mode-p 'lui-mode)))
              (buffer-list))))))

(defun my/circe-switch-to-buffer ()
  (interactive)
  (let ((helm-source-buffers-list my/circe-buffers-source))
    (helm-buffers-list)))

Then run M-x my/circe-switch-to-buffer or bind it to some key-chord. Result looks like this

Helm interface for switching buffers.