gnus-html.el: prefix log messages with function name
[gnus] / lisp / auth-source.el
index 5a628d0..5b44c0b 100644 (file)
 (require 'gnus-util)
 
 (eval-when-compile (require 'cl))
-(eval-when-compile (require 'netrc))
-
-(autoload 'secrets-search-items "secrets")
+(autoload 'netrc-machine-user-or-password "netrc")
+(autoload 'secrets-create-item "secrets")
+(autoload 'secrets-delete-item "secrets")
 (autoload 'secrets-get-alias "secrets")
 (autoload 'secrets-get-attribute "secrets")
+(autoload 'secrets-get-secret "secrets")
+(autoload 'secrets-list-collections "secrets")
+(autoload 'secrets-search-items "secrets")
 
 (defgroup auth-source nil
   "Authentication sources."
@@ -61,6 +64,7 @@
                               (string :tag "Name")))))
 
 ;;; generate all the protocols in a format Customize can use
+;;; TODO: generate on the fly from auth-source-protocols
 (defconst auth-source-protocols-customize
   (mapcar (lambda (a)
            (let ((p (car-safe a)))
@@ -90,7 +94,7 @@ If the value is a function, debug messages are logged by calling
  that function using the same arguments as `message'."
   :group 'auth-source
   :version "23.2" ;; No Gnus
-  :type        `(choice 
+  :type        `(choice
          :tag "auth-source debugging mode"
          (const :tag "Log using `message' to the *Messages* buffer" t)
          (function :tag "Function that takes arguments like `message'")
@@ -103,9 +107,13 @@ Only relevant if `auth-source-debug' is not nil."
   :version "23.2" ;; No Gnus
   :type `boolean)
 
-(defcustom auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t nil))
+(defcustom auth-sources '((:source "~/.authinfo.gpg"))
   "List of authentication sources.
 
+The default will get login and password information from a .gpg
+file, which you should set up with the EPA/EPG packages to be
+encrypted.  See the auth.info manual for details.
+
 Each entry is the authentication type with optional properties.
 
 It's best to customize this with `M-x customize-variable' because the choices
@@ -117,32 +125,29 @@ can get pretty complex."
                       (const :format "" :value :source)
                       (choice :tag "Authentication backend choice"
                               (string :tag "Authentication Source (file)")
-                              (list :tag "secrets.el (Secret Service API/KWallet/GNOME KeyRing)" 
+                              (list :tag "secrets.el (Secret Service API/KWallet/GNOME Keyring)"
                                      (const :format "" :value :secrets)
                                      (choice :tag "Collection to use"
                                              (string :tag "Collection name")
                                              (const :tag "Default" 'default)
-                                             (const :tag "Any" t)
-                                             (const :tag "Temporary" "session")
-                                             (string :tag "Specific session name")
-                                             (const :tag "Fallback" nil))))
-                      (const :format "" :value :host)
-                      (choice :tag "Host (machine) choice"
-                              (const :tag "Any" t)
-                              (regexp :tag "Host (machine) regular expression (TODO)")
-                              (const :tag "Fallback" nil))
-                      (const :format "" :value :protocol)
-                      (choice :tag "Protocol"
-                              (const :tag "Any" t)
-                              (const :tag "Fallback" nil)
-                              ,@auth-source-protocols-customize)
-                      (repeat :tag "Extra Parameters"
+                                             (const :tag "Login" "login")
+                                             (const :tag "Temporary" "session"))))
+                      (repeat :tag "Extra Parameters" :inline t
                               (choice :tag "Extra parameter"
-                                      (list :tag "Preferred username"
-                                            (const :format "" :value :preferred-username)
+                                      (list :tag "Host (omit to match as a fallback)"
+                                            (const :format "" :value :host)
+                                            (choice :tag "Host (machine) choice"
+                                                    (const :tag "Any" t)
+                                                    (regexp :tag "Host (machine) regular expression")))
+                                      (list :tag "Protocol (omit to match as a fallback)"
+                                            (const :format "" :value :protocol)
+                                            (choice :tag "Protocol"
+                                                    (const :tag "Any" t)
+                                                    ,@auth-source-protocols-customize))
+                                      (list :tag "User  (omit to match as a fallback)" :inline t
+                                            (const :format "" :value :user)
                                             (choice :tag "Personality or username"
                                                     (const :tag "Any" t)
-                                                    (const :tag "Fallback" nil)