From 6a6e4d9309bb0f94fbde68f3c3dd2ce275eaf107 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 21 Jun 2011 22:51:45 +0200 Subject: [PATCH] Prefer the ~/.authinfo file over the ~/.authinfo.gpg file, especially when saving. --- lisp/gnus/ChangeLog | 7 +++++++ lisp/gnus/auth-source.el | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 38c8a323eae..818440842cd 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2011-06-21 Lars Magne Ingebrigtsen + + * auth-source.el (auth-source-netrc-create): Don't print all tokens in + %S format, since that looks odd. + (auth-sources): Prefer the ~/.authinfo file over the ~/.authinfo.gpg + file, especially when saving. + 2011-06-18 Teodor Zlatanov * auth-source.el (auth-source-netrc-use-gpg-tokens): Replace diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index e36bc9fbedd..d3261b137b2 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -208,7 +208,7 @@ If the value is a function, debug messages are logged by calling (function :tag "Function that takes arguments like `message'") (const :tag "Don't log anything" nil))) -(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc") +(defcustom auth-sources '("~/.authinfo" "~/.authinfo.gpg" "~/.netrc") "List of authentication sources. The default will get login and password information from @@ -1281,7 +1281,7 @@ See `auth-source-search' for details on SPEC." (let ((printer (lambda () ;; append the key (the symbol name of r) ;; and the value in r - (format "%s%s %S" + (format "%s%s %s" ;; prepend a space (if (zerop (length add)) "" " ") ;; remap auth-source tokens to netrc @@ -1291,8 +1291,9 @@ See `auth-source-search' for details on SPEC." (secret "password") (port "port") ; redundant but clearer (t (symbol-name r))) - ;; the value will be printed in %S format - data)))) + (if (string-match "[\" ]" data) + (format "%S" data) + data))))) (setq add (concat add (funcall printer))))))) (plist-put -- 2.39.2