;; Copyright (C) 1987, 1988, 1989, 1990, 1992, 1993,
;; 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002,
-;; 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published
-;; by the Free Software Foundation; either version 3, or (at your
-;; option) any later version.
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
-;; GNU Emacs is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
-;; MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(eval-when-compile (require 'cl))
+(autoload 'auth-source-user-or-password "auth-source")
+
(defgroup nntp nil
"NNTP access for Gnus."
:group 'gnus)
(let* ((list (netrc-parse nntp-authinfo-file))
(alist (netrc-machine list nntp-address "nntp"))
(force (or (netrc-get alist "force") nntp-authinfo-force))
- (user (or (netrc-get alist "login") nntp-authinfo-user))
- (passwd (netrc-get alist "password")))
+ (auth-info
+ (auth-source-user-or-password '("login" "password") nntp-address "nntp"))
+ (auth-user (nth 0 auth-info))
+ (auth-passwd (nth 1 auth-info))
+ (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"))))
(when (or (not send-if-force)
force)
(unless user
(defun nntp-open-network-stream (buffer)
(open-network-stream "nntpd" buffer nntp-address nntp-port-number))
-(eval-and-compile
- (autoload 'format-spec "format-spec")
- (autoload 'format-spec-make "format-spec")
- (autoload 'open-tls-stream "tls"))
+(autoload 'format-spec "format-spec")
+(autoload 'format-spec-make "format-spec")
+(autoload 'open-tls-stream "tls")
(defun nntp-open-ssl-stream (buffer)
(let* ((process-connection-type nil)
(make-directory (directory-file-name dir) t)
(nnheader-message 5 "Creating nntp marks directory %s" dir))))
-(eval-and-compile
- (autoload 'time-less-p "time-date"))
+(autoload 'time-less-p "time-date")
(defun nntp-marks-changed-p (group server)
(let ((file (nntp-group-pathname server group nntp-marks-file-name))