Function: plstore--decode

plstore--decode is a byte-compiled function defined in plstore.el.gz.

Signature

(plstore--decode STRING)

Documentation

Create a plstore instance from STRING.

STRING should be the printed representation of a decoded alist of some plstore.

Source Code

;; Defined in /usr/src/emacs/lisp/plstore.el.gz
(defun plstore--decode (string)
  "Create a plstore instance from STRING.
STRING should be the printed representation of a decoded alist of
some plstore."
  (let* ((alist (car (read-from-string string)))
	 (pointer alist)
	 secret-alist
	 plist
	 entry)
    (while pointer
      (unless (stringp (car (car pointer)))
	(error "Invalid plstore format %s" string))
      (setq plist (cdr (car pointer)))
      (while plist
	(when (plstore--has-secret-keys plist)
	  (setq entry (assoc (car (car pointer)) secret-alist))
	  (unless entry
	    (setq entry (list (car (car pointer)))
		  secret-alist (cons entry secret-alist)))
	  (setcdr entry (plist-put (cdr entry)
				   (intern (concat ":"
						(substring (symbol-name
							    (car plist))
							   (match-end 0))))
				   (car (cdr plist))))
	  (setcar (cdr plist) t))
	(setq plist (nthcdr 2 plist)))
      (setq pointer (cdr pointer)))
    (plstore--make nil alist nil secret-alist)))