emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix/bug-48598 a999ff61fa 19/27: Register erc-kill-buffer-function locall


From: F. Jason Park
Subject: fix/bug-48598 a999ff61fa 19/27: Register erc-kill-buffer-function locally
Date: Fri, 8 Apr 2022 03:06:51 -0400 (EDT)

branch: fix/bug-48598
commit a999ff61fa271872894e61f9d6fb2b71b5809bf3
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>

    Register erc-kill-buffer-function locally
    
    * lisp/erc/erc.el (erc-kill-buffer-function): don't add hook when
    loading file.  Not that it matters, but this would run twice because
    of the erc{-backend} dependency cycle.  Move to major-mode setup and
    make buffer-local instead.  Depends on tests in Bug#48598.
---
 lisp/erc/erc.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 510fa2c8a8..d54a94bd38 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1569,6 +1569,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
@@ -7060,9 +7061,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'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]