>From 8ede558f8b7885e97bced96f5d06206ecb23a719 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 13 Sep 2021 22:24:57 -0700 Subject: NOT A PATCH Rebased atop commit 25ebb9374bdadf66153727831fc7ff131c8cf299 Author: Stefan Kangas Date: Tue Sep 14 07:55:56 2021 +0200 ; More minor docfixes found by checkdoc for easier am-ing, should anyone want to inspect the changes in-tree. Also, one tweak to the commit message isn't shown in the diff below but has to do with no longer removing erc-nickserv-call-identity-function. In general, I'm pretty much indifferent about preserving a revised rendition of that function as a disembodied wrapper for erc-nickserv-identify. On the one hand, anyone desperate/resourceful enough to have sought out the original (way back whenever) should be capable of taking a little churn in stride. That said, if I were enumerating things to delete from ERC, I'm not sure that'd make the top ten. Olivier Certner (1): ERC: NickServ: Prompt for password last, overall simplifications (bug#46777) etc/NEWS | 13 ++- lisp/erc/erc-services.el | 168 +++++++++++++++++++++++---------------- 2 files changed, 108 insertions(+), 73 deletions(-) Interdiff: diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index 4233b4a322..adb3f521cd 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -404,20 +404,20 @@ erc-nickserv-identify-autodetect identify-regex (string-match identify-regex msg)) (erc-log "NickServ IDENTIFY request detected") - (erc-nickserv-identify nick) + (erc-nickserv-identify nil nick) nil)))) (defun erc-nickserv-identify-on-connect (_server nick) "Identify to Nickserv after the connection to the server is established." (unless (and (eq erc-nickserv-identify-mode 'both) (erc-nickserv-alist-regexp (erc-network))) - (erc-nickserv-identify nick))) + (erc-nickserv-identify nil nick))) (defun erc-nickserv-identify-on-nick-change (nick _old-nick) "Identify to Nickserv whenever your nick changes." (unless (and (eq erc-nickserv-identify-mode 'both) (erc-nickserv-alist-regexp (erc-network))) - (erc-nickserv-identify nick))) + (erc-nickserv-identify nil nick))) (defun erc-nickserv-get-password (nick) "Return the password for NICK from configured sources. @@ -481,8 +481,13 @@ erc-nickserv-send-identify (erc-message msgtype (concat nickserv " " identify-word " " nick password)))) +(defun erc-nickserv-call-identify-function (nickname) + "Call `erc-nickserv-identify' with NICKNAME." + (declare (obsolete erc-nickserv-identify "28.1")) + (erc-nickserv-identify nil nickname)) + ;;;###autoload -(defun erc-nickserv-identify (&optional nick) +(defun erc-nickserv-identify (&optional password nick) "Identify to NickServ immediately. Identification will either use NICK or the current nick if not provided, and some password obtained through @@ -495,16 +500,18 @@ erc-nickserv-identify Returns t if the identify message could be sent, nil otherwise." (interactive (list + nil (read-from-minibuffer "Nickname: " nil nil nil 'erc-nick-history-list (erc-current-nick)))) (unless (and nick (not (string= nick ""))) (setq nick (erc-current-nick))) - (let ((password (erc-nickserv-get-password nick))) - (if password - (erc-nickserv-send-identify nick password) - (erc-error "Cannot find a password for nickname %s" - nick) - nil))) + (unless password + (setq password (erc-nickserv-get-password nick))) + (if password + (erc-nickserv-send-identify nick password) + (erc-error "Cannot find a password for nickname %s" + nick) + nil)) (provide 'erc-services) -- 2.31.1