Merge branch 'master' of https://git.gnus.org/gnus
[gnus] / lisp / auth-source.el
index 21df923..e0da445 100644 (file)
@@ -218,7 +218,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
@@ -980,7 +980,7 @@ Note that the MAX parameter is used so we can exit the parse early."
          (,(if (boundp 'find-file-hook) 'find-file-hook 'find-file-hooks)
           ',(remove
              'epa-file-find-file-hook
-             ,(if (boundp 'find-file-hook) 'find-file-hook 'find-file-hooks)))
+             (if (boundp 'find-file-hook) 'find-file-hook 'find-file-hooks)))
          (auto-mode-alist
           ',(if (boundp 'epa-file-auto-mode-alist-entry)
                 (remove (symbol-value 'epa-file-auto-mode-alist-entry)
@@ -1291,7 +1291,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
@@ -1301,8 +1301,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