* mm-encode.el (mm-sign-option, mm-encrypt-option): New user option;
[gnus] / lisp / nntp.el
index fb35609..8a6c9a2 100644 (file)
@@ -2,27 +2,25 @@
 
 ;; 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:
 
@@ -38,8 +36,7 @@
 
 (eval-when-compile (require 'cl))
 
-(eval-and-compile
-  (autoload 'auth-source-user-or-password "auth-source"))
+(autoload 'auth-source-user-or-password "auth-source")
 
 (defgroup nntp nil
   "NNTP access for Gnus."
@@ -1182,14 +1179,18 @@ If SEND-IF-FORCE, only send authinfo to the server if the
   (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 
+        (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-source-user-or-password "login" nntp-address "nntp")
-               (netrc-get alist "login") 
+               auth-user
+               (netrc-get alist "login")
                nntp-authinfo-user))
         (passwd (or
                  ;; this is preferred to netrc-*
-                 (auth-source-user-or-password "password" nntp-address "nntp")
+                 auth-passwd
                  (netrc-get alist "password"))))
     (when (or (not send-if-force)
              force)
@@ -1304,10 +1305,9 @@ password contained in '~/.nntp-authinfo'."
 (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)
@@ -2122,8 +2122,7 @@ Please refer to the following variables to customize the connection:
       (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))