From 0116c660c22eb8c13c0c6eddc8cf61db0c22ca7b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 4 Aug 2022 15:37:31 +0200 Subject: [PATCH] Clean up nntp-send-authinfo after removing obsolete variable * lisp/gnus/nntp.el (netrc-parse, netrc-machine, netrc-get): Remove declarations. (nntp-send-authinfo): Now that `nntp-authinfo-file' is removed, don't parse the .authinfo file twice, but just rely on the auth-source functions (bug#56972). --- lisp/gnus/nntp.el | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index b26afe6e783..29570fa8c9f 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1133,11 +1133,6 @@ It will make innd servers spawn an nnrpd process to allow actual article reading." (nntp-send-command "^.*\n" "MODE READER")) -(declare-function netrc-parse "netrc" (&optional file)) -(declare-function netrc-machine "netrc" - (list machine &optional port defaultport)) -(declare-function netrc-get "netrc" (alist type)) - (defun nntp-send-authinfo (&optional send-if-force) "Send the AUTHINFO to the nntp server. It will look in the \"~/.authinfo\" file for matching entries. If @@ -1146,30 +1141,16 @@ and a password. If SEND-IF-FORCE, only send authinfo to the server if the .authinfo file has the FORCE token." - (require 'netrc) - (let* ((list (netrc-parse)) - (alist (netrc-machine list nntp-address "nntp")) - (auth-info + (let* ((auth-info (nth 0 (auth-source-search :max 1 :host (list nntp-address (nnoo-current-server 'nntp)) :port `("119" "nntp" ,(format "%s" nntp-port-number) "563" "nntps" "snews")))) (auth-user (plist-get auth-info :user)) - (auth-force (plist-get auth-info :force)) - (auth-passwd (auth-info-password auth-info)) - (force (or (netrc-get alist "force") - nntp-authinfo-force - auth-force)) - (user (or - ;; this is preferred to netrc-* - auth-user - (netrc-get alist "login") - nntp-authinfo-user)) - (passwd (or - ;; this is preferred to netrc-* - auth-passwd - (netrc-get alist "password")))) + (passwd (auth-info-password auth-info)) + (force (or nntp-authinfo-force (plist-get auth-info :force))) + (user (or auth-user nntp-authinfo-user))) (when (or (not send-if-force) force) (unless user -- 2.39.2