]> code.delx.au - gnu-emacs/blobdiff - lisp/net/secrets.el
Merge branch 'erc-async-reconnect' into emacs-25
[gnu-emacs] / lisp / net / secrets.el
index f7bb91b14f626b5d79edfe1eba5a9a497941f7ae..5e0274029f12243e94b696ecc74551a052c6daf6 100644 (file)
@@ -85,7 +85,7 @@
 ;; temporarily.  This shall be preferred over creation of a persistent
 ;; collection, when the information shall not live longer than Emacs.
 ;; The session collection can be addressed either by the string
-;; "session", or by `nil', whenever a collection parameter is needed.
+;; "session", or by nil, whenever a collection parameter is needed.
 
 ;; As already said, a collection is a group of secret items.  A secret
 ;; item has a label, the "secret" (which is a string), and a set of
@@ -418,7 +418,7 @@ returned, and it will be stored in `secrets-session-path'."
 (defun secrets-prompt-handler (&rest args)
   "Handler for signals emitted by `secrets-interface-prompt'."
   ;; An empty object path is always identified as `secrets-empty-path'
-  ;; or `nil'.  Either we set it explicitly, or it is returned by the
+  ;; or nil.  Either we set it explicitly, or it is returned by the
   ;; "Completed" signal.
   (if (car args) ;; dismissed
       (setq secrets-prompt-signal (list secrets-empty-path))
@@ -598,10 +598,9 @@ If successful, return the object path of the collection."
 ATTRIBUTES are key-value pairs.  The keys are keyword symbols,
 starting with a colon.  Example:
 
-  \(secrets-create-item \"Tramp collection\" \"item\" \"geheim\"
-   :method \"sudo\" :user \"joe\" :host \"remote-host\"\)
+  (secrets-search-items \"Tramp collection\" :user \"joe\")
 
-The object paths of the found items are returned as list."
+The object labels of the found items are returned as list."
   (let ((collection-path (secrets-unlock-collection collection))
        result props)
     (unless (secrets-empty-path collection-path)
@@ -618,8 +617,7 @@ The object paths of the found items are returned as list."
                           (cadr attributes))
                     'append)
              attributes (cddr attributes)))
-      ;; Search.  The result is a list of two lists, the object paths
-      ;; of the unlocked and the locked items.
+      ;; Search.  The result is a list of object paths.
       (setq result
            (dbus-call-method
             :session secrets-service collection-path
@@ -630,15 +628,15 @@ The object paths of the found items are returned as list."
       ;; Return the found items.
       (mapcar
        (lambda (item-path) (secrets-get-item-property item-path "Label"))
-       (append (car result) (cadr result))))))
+       result))))
 
 (defun secrets-create-item (collection item password &rest attributes)
   "Create a new item in COLLECTION with label ITEM and password PASSWORD.
 ATTRIBUTES are key-value pairs set for the created item.  The
 keys are keyword symbols, starting with a colon.  Example:
 
-  \(secrets-create-item \"Tramp collection\" \"item\" \"geheim\"
-   :method \"sudo\" :user \"joe\" :host \"remote-host\"\)
+  (secrets-create-item \"Tramp collection\" \"item\" \"geheim\"
+   :method \"sudo\" :user \"joe\" :host \"remote-host\")
 
 The object path of the created item is returned."
   (unless (member item (secrets-list-items collection))
@@ -702,7 +700,7 @@ If there is no such item, return nil."
   (let ((item-path (secrets-item-path collection item)))
     (unless (secrets-empty-path item-path)
       (dbus-byte-array-to-string
-       (caddr
+       (nth 2
        (dbus-call-method
         :session secrets-service item-path secrets-interface-item
         "GetSecret" :object-path secrets-session-path))))))