summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2021-10-27 21:13:24 -0700
committerF. Jason Park <jp@neverwas.me>2022-06-30 15:15:27 -0700
commit7c47d6c52d70225334444947824b40ad9f593c31 (patch)
treee2180ad051bf976f911f9fe538d04be645052395
parent922ad238403d8d821bd696372ffe58572df12670 (diff)
downloademacs-7c47d6c52d70225334444947824b40ad9f593c31.tar.gz
Register erc-kill-buffer-function locally
* lisp/erc/erc.el (erc-kill-buffer-function): Don't add hook when loading file. Move to major-mode setup and make buffer-local instead. Depends on tests in bug#48598.
-rw-r--r--lisp/erc/erc.el4
1 files changed, 1 insertions, 3 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 18a353ae494..cbb0c9f4b4d 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1591,6 +1591,7 @@ Defaults to the server buffer."
(setq-local paragraph-start
(concat "\\(" (regexp-quote (erc-prompt)) "\\)"))
(setq-local completion-ignore-case t)
+ (add-hook 'kill-buffer-hook #'erc-kill-buffer-function nil t)
(add-hook 'completion-at-point-functions #'erc-complete-word-at-point nil t))
;; activation
@@ -7111,9 +7112,6 @@ See also `format-spec'."
;;; Various hook functions
-;; FIXME: Don't set the hook globally!
-(add-hook 'kill-buffer-hook #'erc-kill-buffer-function)
-
(defcustom erc-kill-server-hook '(erc-kill-server
erc-networks-shrink-ids-and-buffer-names)
"Invoked whenever a live server buffer is killed via `kill-buffer'."