Add Secrets API search examples.
authorTed Zlatanov <tzz@lifelogs.com>
Sun, 6 Feb 2011 17:30:40 +0000 (11:30 -0600)
committerTed Zlatanov <tzz@lifelogs.com>
Sun, 6 Feb 2011 19:50:00 +0000 (13:50 -0600)
* auth-source.el (auth-source-secrets-search): Add examples.

lisp/ChangeLog
lisp/auth-source.el

index c9aced6..208b8a9 100644 (file)
@@ -1,3 +1,7 @@
+2011-02-06  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * auth-source.el (auth-source-secrets-search): Add examples.
+
 2011-02-06  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * nntp.el (nntp-finish-retrieve-group-infos): Protect against the first
index dde4cad..0283233 100644 (file)
@@ -862,6 +862,7 @@ See `auth-source-search' for details on SPEC."
 ;;; (let ((auth-sources '(default))) (auth-source-search :max 1 :delete t))
 ;;; (let ((auth-sources '(default))) (auth-source-search :max 1))
 ;;; (let ((auth-sources '("secrets:login"))) (auth-source-search :max 1))
+;;; (let ((auth-sources '("secrets:login"))) (auth-source-search :max 1 :signon_realm "https://git.gnus.org/Git"))
 
 (defun* auth-source-secrets-search (&rest
                                     spec
@@ -879,7 +880,25 @@ matching, do a wider search and narrow it down yourself.
 
 You'll get back all the properties of the token as a plist.
 
-TODO: Example."
+Here's an example that looks for the first item in the 'login'
+Secrets collection:
+
+ \(let ((auth-sources '(\"secrets:login\")))
+    (auth-source-search :max 1)
+
+Here's another that looks for the first item in the 'login'
+Secrets collection whose label contains 'gnus':
+
+ \(let ((auth-sources '(\"secrets:login\")))
+    (auth-source-search :max 1 :label \"gnus\")
+
+And this one looks for the first item in the 'login' Secrets
+collection that's a Google Chrome entry for the git.gnus.org site
+login:
+
+ \(let ((auth-sources '(\"secrets:login\")))
+    (auth-source-search :max 1 :signon_realm \"https://git.gnus.org/Git\"))
+"
 
   ;; TODO
   (assert (not create) nil