From b3d315efc210d47b22791dd938e6354bcb0f089c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 4 Dec 2020 11:14:26 +0100 Subject: [PATCH] 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. --- lisp/erc/erc-goodies.el | 3 +-- lisp/erc/erc-list.el | 12 ++++++------ lisp/erc/erc-pcomplete.el | 22 ++++++++++------------ lisp/erc/erc.el | 13 ++++++------- 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index a475f0a1770..350eb89b666 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -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") diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el index 036d7733ed7..ae7c2e5f2fa 100644 --- a/lisp/erc/erc-list.el +++ b/lisp/erc/erc-list.el @@ -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))) diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index f8b7e13be02..c4932f2bde2 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -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 diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 94ea0de7ee7..d0b511dc0a2 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -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)) -- 2.39.5