Commit 594fd343 authored by Phil Sainty's avatar Phil Sainty

erc: Rename abnormal hooks to use "-functions" suffix (bug 34657)

* lisp/erc/erc.el (erc-before-connect, erc-after-connect):
Now obsolete aliases.  All uses changed.
(erc-before-connect-functions, erc-after-connect-functions):
New names with the standard suffix for abnormal hooks.

* etc/NEWS: Mention the changes.
parent 2f7885a4
Pipeline #864 passed with stage
in 58 minutes and 12 seconds
......@@ -682,6 +682,12 @@ This option controls whether and how to use Gnus search groups as
*** 'erc-button-google-url' has been renamed 'erc-button-search-url'
and its value has been changed to Duck Duck Go.
---
*** Abnormal hooks 'erc-before-connect' and 'erc-after-connect' have
been renamed to 'erc-before-connect-functions' and
'erc-after-connect-functions'. The original names have been retained
as obsolete aliases.
** EUDC
*** XEmacs support has been removed.
......
......@@ -114,7 +114,7 @@ Related variables: `erc-public-away-p' and `erc-away-nickname'."
(add-hook 'erc-send-completed-hook 'erc-autoaway-reset-idle-irc)
(add-hook 'erc-server-001-functions 'erc-autoaway-reset-idle-irc))
((eq erc-autoaway-idle-method 'user)
(add-hook 'erc-after-connect 'erc-autoaway-insinuate-maybe)
(add-hook 'erc-after-connect-functions 'erc-autoaway-insinuate-maybe)
(add-hook 'erc-disconnected-hook 'erc-autoaway-remove-maybe)
(erc-autoaway-insinuate-maybe))
((eq erc-autoaway-idle-method 'emacs)
......@@ -130,7 +130,7 @@ Related variables: `erc-public-away-p' and `erc-away-nickname'."
(remove-hook 'erc-server-001-functions 'erc-autoaway-reset-idle-irc))
((eq erc-autoaway-idle-method 'user)
(remove-hook 'post-command-hook 'erc-autoaway-reset-idle-user)
(remove-hook 'erc-after-connect 'erc-autoaway-insinuate-maybe)
(remove-hook 'erc-after-connect-functions 'erc-autoaway-insinuate-maybe)
(remove-hook 'erc-disconnected-hook 'erc-autoaway-remove-maybe))
((eq erc-autoaway-idle-method 'emacs)
(erc-cancel-timer erc-autoaway-idletimer)
......
......@@ -42,11 +42,11 @@
;;;###autoload(autoload 'erc-autojoin-mode "erc-join" nil t)
(define-erc-module autojoin nil
"Makes ERC autojoin on connects and reconnects."
((add-hook 'erc-after-connect 'erc-autojoin-channels)
((add-hook 'erc-after-connect-functions 'erc-autojoin-channels)
(add-hook 'erc-nickserv-identified-hook 'erc-autojoin-after-ident)
(add-hook 'erc-server-JOIN-functions 'erc-autojoin-add)
(add-hook 'erc-server-PART-functions 'erc-autojoin-remove))
((remove-hook 'erc-after-connect 'erc-autojoin-channels)
((remove-hook 'erc-after-connect-functions 'erc-autojoin-channels)
(remove-hook 'erc-nickserv-identified-hook 'erc-autojoin-after-ident)
(remove-hook 'erc-server-JOIN-functions 'erc-autojoin-add)
(remove-hook 'erc-server-PART-functions 'erc-autojoin-remove)))
......
......@@ -107,7 +107,7 @@ You can also use \\[erc-nickserv-identify-mode] to change modes."
((erc-nickserv-identify-mode erc-nickserv-identify-mode))
((remove-hook 'erc-server-NOTICE-functions
'erc-nickserv-identify-autodetect)
(remove-hook 'erc-after-connect
(remove-hook 'erc-after-connect-functions
'erc-nickserv-identify-on-connect)
(remove-hook 'erc-nick-changed-functions
'erc-nickserv-identify-on-nick-change)
......@@ -133,11 +133,11 @@ You can also use \\[erc-nickserv-identify-mode] to change modes."
'erc-nickserv-identify-autodetect)
(remove-hook 'erc-nick-changed-functions
'erc-nickserv-identify-on-nick-change)
(remove-hook 'erc-after-connect
(remove-hook 'erc-after-connect-functions
'erc-nickserv-identify-on-connect))
((eq mode 'nick-change)
(setq erc-nickserv-identify-mode 'nick-change)
(add-hook 'erc-after-connect
(add-hook 'erc-after-connect-functions
'erc-nickserv-identify-on-connect)
(add-hook 'erc-nick-changed-functions
'erc-nickserv-identify-on-nick-change)
......@@ -147,7 +147,7 @@ You can also use \\[erc-nickserv-identify-mode] to change modes."
(setq erc-nickserv-identify-mode 'both)
(add-hook 'erc-server-NOTICE-functions
'erc-nickserv-identify-autodetect)
(add-hook 'erc-after-connect
(add-hook 'erc-after-connect-functions
'erc-nickserv-identify-on-connect)
(add-hook 'erc-nick-changed-functions
'erc-nickserv-identify-on-nick-change))
......@@ -155,7 +155,7 @@ You can also use \\[erc-nickserv-identify-mode] to change modes."
(setq erc-nickserv-identify-mode nil)
(remove-hook 'erc-server-NOTICE-functions
'erc-nickserv-identify-autodetect)
(remove-hook 'erc-after-connect
(remove-hook 'erc-after-connect-functions
'erc-nickserv-identify-on-connect)
(remove-hook 'erc-nick-changed-functions
'erc-nickserv-identify-on-nick-change)
......
......@@ -1983,7 +1983,8 @@ Returns the buffer for the given server or channel."
(old-buffer (current-buffer))
old-point
continued-session)
(when connect (run-hook-with-args 'erc-before-connect server port nick))
(when connect
(run-hook-with-args 'erc-before-connect-functions server port nick))
(erc-update-modules)
(set-buffer buffer)
(setq old-point (point))
......@@ -2118,7 +2119,10 @@ If no buffer matches, return nil."
(erc-port-equal erc-session-port port)
(erc-current-nick-p nick)))))
(defcustom erc-before-connect nil
(define-obsolete-variable-alias
'erc-before-connect 'erc-before-connect-functions "27.1")
(defcustom erc-before-connect-functions nil
"Hook called before connecting to a server.
This hook gets executed before `erc' actually invokes `erc-mode'
with your input data. The functions in here get called with three
......@@ -2126,7 +2130,10 @@ parameters, SERVER, PORT and NICK."
:group 'erc-hooks
:type 'hook)
(defcustom erc-after-connect nil
(define-obsolete-variable-alias
'erc-after-connect 'erc-after-connect-functions "27.1")
(defcustom erc-after-connect-functions nil
"Hook called after connecting to a server.
This hook gets executed when an end of MOTD has been received. All
functions in here get called with the parameters SERVER and NICK."
......@@ -4524,7 +4531,7 @@ See also: `erc-echo-notice-in-user-buffers',
(defun erc-connection-established (proc parsed)
"Run just after connection.
Set user modes and run `erc-after-connect' hook."
Set user modes and run `erc-after-connect-functions' hook."
(with-current-buffer (process-buffer proc)
(unless erc-server-connected ; only once per session
(let ((server (or erc-server-announced-name
......@@ -4536,7 +4543,7 @@ Set user modes and run `erc-after-connect' hook."
(erc-update-mode-line)
(erc-set-initial-user-mode nick buffer)
(erc-server-setup-periodical-ping buffer)
(run-hook-with-args 'erc-after-connect server nick)))))
(run-hook-with-args 'erc-after-connect-functions server nick)))))
(defun erc-set-initial-user-mode (nick buffer)
"If `erc-user-mode' is non-nil for NICK, set the user modes.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment