Changes committed gnus/contrib (ChangeLog sendmail.el smtpmail.el xml.el)

"Miles Bader" <[email protected]>
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog sendmail.el smtpmail.el xml.el

Merge from emacs--devo--0

Patches applied:

 * emacs--devo--0  (patch 1144-1145, 1147, 1149, 1151, 1153, 1161, 1163, 1165, 1167-1168)

   - Update from CVS
   - Merge from gnus--devo--0

2008-05-19  Teodor Zlatanov  <[email protected]>

   * contrib/mail/smtpmail.el: Add autoload for `auth-source-user-or-password'.
   (smtpmail-try-auth-methods): Use it.

2008-05-08  Stefan Monnier  <[email protected]>

   * lisp/rfc2104.el (rfc2104-hexstring-to-bitstring): Rename it back from
   rfc2104-hexstring-to-byte-list.  Return a unibyte string.
   (rfc2104-hash): Use it.

2008-05-08  Juanma Barranquero  <[email protected]>

   * lisp/gnus-art.el (gnus-article-toggle-truncate-lines):
   Don't use `iff' in docstring.

Revision: [email protected]/gnus--devo--0--patch-497


Index: ChangeLog
diff -u gnus/contrib/ChangeLog:7.73 gnus/contrib/ChangeLog:7.74
--- ChangeLog:7.73	Thu May 15 22:11:34 2008
+++ ChangeLog	Mon May 19 10:47:43 2008
@@ -1,3 +1,8 @@
+2008-05-19  Teodor Zlatanov  <[email protected]>
+
+	* mail/smtpmail.el: Add autoload for `auth-source-user-or-password'.
+	(smtpmail-try-auth-methods): Use it.
+
 2008-05-15  Andreas Schwab  <[email protected]>
 
 	* nnir.el (nnir-add-result): Properly substitute the parameters.
@@ -572,7 +577,7 @@
 	(gpg-encrypt): Add passphrase as a parameter.
 
     Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-    2007 Free Software Foundation, Inc.
+    2007, 2008 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
Index: sendmail.el
diff -u gnus/contrib/sendmail.el:7.9 gnus/contrib/sendmail.el:7.10
--- sendmail.el:7.9	Sun Jan 20 06:23:59 2008
+++ sendmail.el	Mon May 19 10:47:43 2008
@@ -8,10 +8,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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.
+;; 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
@@ -19,9 +19,7 @@
 ;; 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, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
Index: smtpmail.el
diff -u gnus/contrib/smtpmail.el:7.13 gnus/contrib/smtpmail.el:7.14
--- smtpmail.el:7.13	Thu Apr 24 06:19:22 2008
+++ smtpmail.el	Mon May 19 10:47:43 2008
@@ -14,10 +14,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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.
+;; 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
@@ -25,9 +25,7 @@
 ;; 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, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -85,6 +83,9 @@
 (autoload 'netrc-machine "netrc")
 (autoload 'netrc-get "netrc")
 
+(eval-and-compile
+  (autoload 'auth-source-user-or-password "auth-source"))
+
 ;;;
 (defgroup smtpmail nil
   "SMTP protocol for sending mail."
@@ -547,17 +548,29 @@
 (defun smtpmail-try-auth-methods (process supported-extensions host port)
   (let* ((mechs (cdr-safe (assoc 'auth supported-extensions)))
 	 (mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
-	 (cred (if (stringp smtpmail-auth-credentials)
-		   (let* ((netrc (netrc-parse smtpmail-auth-credentials))
-                          (port-name (format "%s" (or port "smtp")))
-			  (hostentry (netrc-machine netrc host port-name
-                                                    port-name)))
-                     (when hostentry
-                       (list host port
-                             (netrc-get hostentry "login")
-                             (netrc-get hostentry "password"))))
-		 (smtpmail-find-credentials
-		  smtpmail-auth-credentials host port)))
+	 (auth-user (auth-source-user-or-password 
+		     "login" host (or port "smtp")))
+	 (auth-pass (auth-source-user-or-password 
+		     "password" host (or port "smtp")))
+	 (cred (if (and auth-user auth-pass) ; try user-auth-* before netrc-*
+		   (list host port auth-user auth-pass)
+		 ;; else, if auth-source didn't return them...
+		 (if (stringp smtpmail-auth-credentials)
+		     (let* ((netrc (netrc-parse smtpmail-auth-credentials))
+			    (port-name (format "%s" (or port "smtp")))
+			    (hostentry (netrc-machine netrc host port-name
+						      port-name)))
+		       (when hostentry
+			 (list host port
+			       (netrc-get hostentry "login")
+			       (netrc-get hostentry "password"))))
+		   ;; else, try smtpmail-find-credentials since
+		   ;; smtpmail-auth-credentials is not a string
+		   (smtpmail-find-credentials
+		    smtpmail-auth-credentials host port))))
+	 (prompt (when cred (format "SMTP password for %s:%s: "
+				    (smtpmail-cred-server cred)
+				    (smtpmail-cred-port cred))))
 	 (passwd (when cred
 		   (or (smtpmail-cred-passwd cred)
 		       (read-passwd
Index: xml.el
diff -u gnus/contrib/xml.el:7.4 gnus/contrib/xml.el:7.5
--- xml.el:7.4	Thu Oct  4 20:51:27 2007
+++ xml.el	Mon May 19 10:47:43 2008
@@ -8,10 +8,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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.
+;; 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
@@ -19,9 +19,7 @@
 ;; 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, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.