diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-18 23:14:33 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-18 23:14:33 -0400 |
commit | f463633f007a92418f1ea7d46347824d51373aa3 (patch) | |
tree | ea1edcc4443a6f2e4fe722eac9704ce2a1112831 /lisp/erc/erc-capab.el | |
parent | 050b830b698dfe62737428d35fec80f561692b07 (diff) | |
download | emacs-f463633f007a92418f1ea7d46347824d51373aa3.tar.gz |
lisp/erc: Use lexical-binding
Also remove various redundant `:group` arguments.
* lisp/erc/erc-backend.el (define-erc-response-handler): Move `declare`
after the docstring.
* lisp/erc/erc-capab.el: Use lexical-binding.
(erc-capab-identify-activate): Simplify with `member`.
* lisp/erc/erc-dcc.el (erc-dcc): Move before erc-dcc-mode definition,
which refers to it.
(erc-dcc-chat-accept): Remove unused vars `nick` and `buffer`.
* lisp/erc/erc-imenu.el: Use lexical-binding.
(erc-create-imenu-index): Remove unused var `prev-pos`.
* lisp/erc/erc-match.el: Use lexical-binding.
(erc-match-message): Remove unused var `old-pt`.
(erc-match-message): Strength-reduce `eval` to `symbol-value`.
* lisp/erc/erc-page.el: Use lexical-binding.
(erc-page): Move Custom group before `erg-page-mode` which refers to it.
* lisp/erc/erc-replace.el: Use lexical-binding.
(erc-replace-insert): Use `functionp`.
* lisp/erc/erc-status-sidebar.el: Use lexical-binding.
(erc-status-sidebar-open): Remove unused var `sidebar-window`.
* lisp/erc/erc.el: Fix header to use the customary 3 semi-colons.
(erc-fill-column): Declare variable.
* lisp/erc/erc-autoaway.el: Use lexical-binding.
* lisp/erc/erc-ezbounce.el: Use lexical-binding.
* lisp/erc/erc-fill.el: Use lexical-binding.
* lisp/erc/erc-goodies.el: Use lexical-binding.
* lisp/erc/erc-ibuffer.el: Use lexical-binding.
* lisp/erc/erc-identd.el: Use lexical-binding.
* lisp/erc/erc-join.el: Use lexical-binding.
* lisp/erc/erc-lang.el: Use lexical-binding.
* lisp/erc/erc-log.el: Use lexical-binding.
* lisp/erc/erc-menu.el: Use lexical-binding.
* lisp/erc/erc-netsplit.el: Use lexical-binding.
* lisp/erc/erc-networks.el: Use lexical-binding.
* lisp/erc/erc-pcomplete.el: Use lexical-binding.
* lisp/erc/erc-ring.el: Use lexical-binding.
* lisp/erc/erc-speedbar.el: Use lexical-binding.
* lisp/erc/erc-spelling.el: Use lexical-binding.
* lisp/erc/erc-truncate.el: Use lexical-binding.
* lisp/erc/erc-xdcc.el: Use lexical-binding.
Diffstat (limited to 'lisp/erc/erc-capab.el')
-rw-r--r-- | lisp/erc/erc-capab.el | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 4e4d012545a..2028917da0c 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -1,4 +1,4 @@ -;;; erc-capab.el --- support for dancer-ircd and hyperion's CAPAB +;;; erc-capab.el --- support for dancer-ircd and hyperion's CAPAB -*- lexical-binding: t; -*- ;; Copyright (C) 2006-2021 Free Software Foundation, Inc. @@ -80,12 +80,10 @@ If you change this from the default \"*\", be sure to use a character not found in IRC nicknames to avoid confusion." - :group 'erc-capab :type '(choice string (const nil))) (defface erc-capab-identify-unidentified '((t)) ; same as `erc-default-face' "Face to use for `erc-capab-identify-prefix'." - :group 'erc-capab :group 'erc-faces) ;;; Define module: @@ -94,22 +92,22 @@ character not found in IRC nicknames to avoid confusion." (define-erc-module capab-identify nil "Handle dancer-ircd's CAPAB IDENTIFY-MSG and IDENTIFY-CTCP." ;; append so that `erc-server-parameters' is already set by `erc-server-005' - ((add-hook 'erc-server-005-functions 'erc-capab-identify-setup t) - (add-hook 'erc-server-290-functions 'erc-capab-identify-activate) + ((add-hook 'erc-server-005-functions #'erc-capab-identify-setup t) + (add-hook 'erc-server-290-functions #'erc-capab-identify-activate) (add-hook 'erc-server-PRIVMSG-functions - 'erc-capab-identify-remove/set-identified-flag) + #'erc-capab-identify-remove/set-identified-flag) (add-hook 'erc-server-NOTICE-functions - 'erc-capab-identify-remove/set-identified-flag) - (add-hook 'erc-insert-modify-hook 'erc-capab-identify-add-prefix t) + #'erc-capab-identify-remove/set-identified-flag) + (add-hook 'erc-insert-modify-hook #'erc-capab-identify-add-prefix t) (mapc (lambda (buffer) (when buffer (with-current-buffer buffer (erc-capab-identify-setup)))) - (erc-buffer-list 'erc-open-server-buffer-p))) - ((remove-hook 'erc-server-005-functions 'erc-capab-identify-setup) - (remove-hook 'erc-server-290-functions 'erc-capab-identify-activate) + (erc-buffer-list #'erc-open-server-buffer-p))) + ((remove-hook 'erc-server-005-functions #'erc-capab-identify-setup) + (remove-hook 'erc-server-290-functions #'erc-capab-identify-activate) ;; we don't remove the `erc-capab-identify-remove/set-identified-flag' hooks ;; because there doesn't seem to be a way to tell the server to turn it off - (remove-hook 'erc-insert-modify-hook 'erc-capab-identify-add-prefix))) + (remove-hook 'erc-insert-modify-hook #'erc-capab-identify-add-prefix))) ;;; Variables: @@ -121,7 +119,7 @@ character not found in IRC nicknames to avoid confusion." ;;; Functions: -(defun erc-capab-identify-setup (&optional proc parsed) +(defun erc-capab-identify-setup (&optional _proc _parsed) "Set up CAPAB IDENTIFY on the current server. Optional argument PROC is the current server's process. @@ -146,19 +144,19 @@ These arguments are sent to this function when called as a hook in (setq erc-capab-identify-sent t))) -(defun erc-capab-identify-activate (proc parsed) +(defun erc-capab-identify-activate (_proc parsed) "Set `erc-capab-identify-activated' and display an activation message. PROC is the current server's process. PARSED is an `erc-parsed' response struct." - (when (or (string= "IDENTIFY-MSG" (erc-response.contents parsed)) - (string= "IDENTIFY-CTCP" (erc-response.contents parsed))) + (when (member (erc-response.contents parsed) + '("IDENTIFY-MSG" "IDENTIFY-CTCP")) (setq erc-capab-identify-activated t) (erc-display-message parsed 'notice 'active (format "%s activated" (erc-response.contents parsed))))) -(defun erc-capab-identify-remove/set-identified-flag (proc parsed) +(defun erc-capab-identify-remove/set-identified-flag (_proc parsed) "Remove PARSED message's id flag and add the `erc-identified' text property. PROC is the current server's process. |