Prefer setq-local in erc

* lisp/erc/erc-goodies.el (erc-imenu-setup):
* lisp/erc/erc-list.el (erc-list-install-322-handler, erc-cmd-LIST):
* lisp/erc/erc-pcomplete.el (pcomplete-erc-setup):
* lisp/erc/erc.el (erc-mode, erc-update-mode-line-buffer):
Prefer setq-local.
This commit is contained in:
Stefan Kangas 2020-12-04 11:14:26 +01:00
parent cbfce827ac
commit b3d315efc2
4 changed files with 23 additions and 27 deletions

View file

@ -35,8 +35,7 @@
(defun erc-imenu-setup ()
"Setup Imenu support in an ERC buffer."
(set (make-local-variable 'imenu-create-index-function)
'erc-create-imenu-index))
(setq-local imenu-create-index-function #'erc-create-imenu-index))
(add-hook 'erc-mode-hook 'erc-imenu-setup)
(autoload 'erc-create-imenu-index "erc-imenu" "Imenu index creation function")

View file

@ -188,15 +188,15 @@
(lambda (_proc _parsed)
(remove-hook 'erc-server-322-functions 'erc-list-handle-322 t)))
;; Find the list buffer, empty it, and display it.
(set (make-local-variable 'erc-list-buffer)
(get-buffer-create (concat "*Channels of "
erc-server-announced-name
"*")))
(setq-local erc-list-buffer
(get-buffer-create (concat "*Channels of "
erc-server-announced-name
"*")))
(with-current-buffer erc-list-buffer
(erc-list-menu-mode)
(setq buffer-read-only nil)
(erase-buffer)
(set (make-local-variable 'erc-list-server-buffer) server-buffer)
(setq-local erc-list-server-buffer server-buffer)
(setq buffer-read-only t))
(pop-to-buffer erc-list-buffer))
t)
@ -211,7 +211,7 @@ should usually be one or more channels, separated by commas.
Please note that this function only works with IRC servers which conform
to RFC and send the LIST header (#321) at start of list transmission."
(erc-with-server-buffer
(set (make-local-variable 'erc-list-last-argument) line)
(setq-local erc-list-last-argument line)
(erc-once-with-server-event
321
(let ((buf (current-buffer)))

View file

@ -89,18 +89,16 @@ for use on `completion-at-point-function'."
(defun pcomplete-erc-setup ()
"Setup `erc-mode' to use pcomplete."
(set (make-local-variable 'pcomplete-ignore-case)
t)
(set (make-local-variable 'pcomplete-use-paring)
nil)
(set (make-local-variable 'pcomplete-parse-arguments-function)
'pcomplete-erc-parse-arguments)
(set (make-local-variable 'pcomplete-command-completion-function)
'pcomplete/erc-mode/complete-command)
(set (make-local-variable 'pcomplete-command-name-function)
'pcomplete-erc-command-name)
(set (make-local-variable 'pcomplete-default-completion-function)
(lambda () (pcomplete-here (pcomplete-erc-nicks)))))
(setq-local pcomplete-ignore-case t)
(setq-local pcomplete-use-paring nil)
(setq-local pcomplete-parse-arguments-function
#'pcomplete-erc-parse-arguments)
(setq-local pcomplete-command-completion-function
#'pcomplete/erc-mode/complete-command)
(setq-local pcomplete-command-name-function
#'pcomplete-erc-command-name)
(setq-local pcomplete-default-completion-function
(lambda () (pcomplete-here (pcomplete-erc-nicks)))))
;;; Programmable completion logic

View file

@ -1488,12 +1488,12 @@ Defaults to the server buffer."
(define-derived-mode erc-mode fundamental-mode "ERC"
"Major mode for Emacs IRC."
(setq local-abbrev-table erc-mode-abbrev-table)
(set (make-local-variable 'next-line-add-newlines) nil)
(setq-local next-line-add-newlines nil)
(setq line-move-ignore-invisible t)
(set (make-local-variable 'paragraph-separate)
(concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)"))
(set (make-local-variable 'paragraph-start)
(concat "\\(" (regexp-quote (erc-prompt)) "\\)"))
(setq-local paragraph-separate
(concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)"))
(setq-local paragraph-start
(concat "\\(" (regexp-quote (erc-prompt)) "\\)"))
(setq-local completion-ignore-case t)
(add-hook 'completion-at-point-functions 'erc-complete-word-at-point nil t))
@ -6493,8 +6493,7 @@ if `erc-away' is non-nil."
(format-spec erc-header-line-format spec)
nil)))
(cond (erc-header-line-uses-tabbar-p
(set (make-local-variable 'tabbar--local-hlf)
header-line-format)
(setq-local tabbar--local-hlf header-line-format)
(kill-local-variable 'header-line-format))
((null header)
(setq header-line-format nil))