summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-08-04 15:37:31 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-08-04 15:37:31 +0200
commit0116c660c22eb8c13c0c6eddc8cf61db0c22ca7b (patch)
treefb8ca10d5e39f5cc6212e34fae406ed55f1c62d0 /lisp
parent91298084965941f7e3d42d638eb52ebd2df5c509 (diff)
downloademacs-0116c660c22eb8c13c0c6eddc8cf61db0c22ca7b.tar.gz
emacs-0116c660c22eb8c13c0c6eddc8cf61db0c22ca7b.tar.bz2
emacs-0116c660c22eb8c13c0c6eddc8cf61db0c22ca7b.zip
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).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/nntp.el27
1 files 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