[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b3d315e: Prefer setq-local in erc
From: |
Stefan Kangas |
Subject: |
master b3d315e: Prefer setq-local in erc |
Date: |
Fri, 4 Dec 2020 05:14:33 -0500 (EST) |
branch: master
commit b3d315efc210d47b22791dd938e6354bcb0f089c
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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 a475f0a..350eb89 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 036d773..ae7c2e5 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 f8b7e13..c4932f2 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 94ea0de..d0b511d 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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b3d315e: Prefer setq-local in erc,
Stefan Kangas <=