From cb7f42016e6d9baaebfdf083c86988d03d6dafc9 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Fri, 17 Jul 2020 11:59:58 +0200 Subject: Give up on fine-grained erc-modules customization I wanted to add 'notifications to the list, started wondering whether I should change the hook by looping over cons or using append, and got bored. For the record, I want to include: - log - notifications and exclude: - fill --- .emacs | 24 ------------------------ .emacs-custom.el | 2 ++ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.emacs b/.emacs index 1d03ce9..51a9160 100644 --- a/.emacs +++ b/.emacs @@ -283,30 +283,6 @@ (add-hook 'shell-mode-hook 'my/shell-hook) -;; What I mean: -;; (defun my/erc-hook () -;; (add-to-list 'erc-modules 'log) -;; (delq 'fill erc-modules) -;; (erc-update-modules)) -;; -;; That cannot work because erc-update-modules only iterates over -;; erc-modules, so it will not act on the `fill' module. -;; -;; I do *not* want to maintain an exhaustive and manually curated list -;; of ERC modules; I just want to add/remove a few ones. Customizing -;; erc-{log,fill}-mode does not work: the contents of erc-modules -;; take precedence. -;; -;; My best attempt at solving this is thus abusing erc-modules's -;; setter function, which will iterate over items in the old value, -;; and disable those that are absent from the new one. -(defun my/erc-hook () - (let ((new-modules - (delete-dups (remq 'fill (cons 'log erc-modules))))) - (customize-set-variable 'erc-modules new-modules))) - -(add-hook 'erc-mode-hook 'my/erc-hook) - (add-hook 'dired-mode-hook 'diff-hl-dired-mode-unless-remote) (add-to-list 'ibuffer-saved-filter-groups diff --git a/.emacs-custom.el b/.emacs-custom.el index 5b803ec..367015d 100644 --- a/.emacs-custom.el +++ b/.emacs-custom.el @@ -22,6 +22,8 @@ '(erc-log-channels-directory "~/.irc-logs") '(erc-log-write-after-insert t) '(erc-log-write-after-send t) + '(erc-modules + '(autojoin button completion irccontrols list log match menu move-to-prompt netsplit networks noncommands notifications readonly ring stamp track)) '(erc-nick "peniblec") `(erc-notifications-icon ,(concat data-directory "images/icons/hicolor/scalable/apps/emacs.svg")) -- cgit v1.2.3