From a4db13e3a62ecede7740e7b72178e8cb5326afea Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 3 Jun 2016 22:18:45 -0400 Subject: [PATCH] erc: use linum post init and remove weird erc-hook the usage of undocumented erc-hook is weird, let's see if we need it. --- layers/+chat/erc/packages.el | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/layers/+chat/erc/packages.el b/layers/+chat/erc/packages.el index 013f849df..81a921532 100644 --- a/layers/+chat/erc/packages.el +++ b/layers/+chat/erc/packages.el @@ -27,6 +27,7 @@ erc-view-log (erc-yank :location local :excluded t) erc-yt + linum persp-mode )) @@ -48,21 +49,14 @@ (use-package erc :defer t :init - (spacemacs/set-leader-keys - "aie" 'erc - "aiE" 'erc-tls - "aii" 'erc-track-switch-buffer - "aiD" 'erc/default-servers) - ;; utf-8 always and forever - (setq erc-server-coding-system '(utf-8 . utf-8)) - ;; disable linum mode in erc - ;; check if this will not be efficient - (defun no-linum (&rest ignore) - (when (or 'linum-mode global-linum-mode) - (linum-mode 0))) - (spacemacs/add-to-hooks 'no-linum '(erc-hook - erc-mode-hook - erc-insert-pre-hook)) + (progn + (spacemacs/set-leader-keys + "aie" 'erc + "aiE" 'erc-tls + "aii" 'erc-track-switch-buffer + "aiD" 'erc/default-servers) + ;; utf-8 always and forever + (setq erc-server-coding-system '(utf-8 . utf-8))) :config (progn (use-package erc-autoaway @@ -230,6 +224,10 @@ (use-package erc-terminal-notifier :if (executable-find "terminal-notifier"))) +(defun erc/post-init-linum () + (spacemacs/add-to-hooks 'no-linum '(erc-mode-hook + erc-insert-pre-hook))) + (defun erc/post-init-persp-mode () ;; do not save erc buffers (with-eval-after-load 'persp-mode