Function: secrets-create-collection

secrets-create-collection is a byte-compiled function defined in secrets.el.gz.

Signature

(secrets-create-collection COLLECTION &optional ALIAS)

Documentation

Create collection labeled COLLECTION if it doesn't exist.

Set ALIAS as alias of the collection. Return the D-Bus object path for collection.

Source Code

;; Defined in /usr/src/emacs/lisp/net/secrets.el.gz
(defun secrets-create-collection (collection &optional alias)
  "Create collection labeled COLLECTION if it doesn't exist.
Set ALIAS as alias of the collection.  Return the D-Bus object
path for collection."
  (let ((collection-path (secrets-collection-path collection)))
    ;; Create the collection.
    (when (secrets-empty-path collection-path)
      (setq collection-path
	    (secrets-prompt
	     (cadr
	      ;; "CreateCollection" returns the prompt path as second arg.
	      (dbus-call-method
	       :session secrets-service secrets-path
	       secrets-interface-service "CreateCollection"
	       `(:array
		 (:dict-entry ,(concat secrets-interface-collection ".Label")
			      (:variant ,collection)))
	       (or alias ""))))))
    ;; Return object path of the collection.
    collection-path))