+2011-06-30 Daiki Ueno <ueno@unixuser.org>
+
+ * plstore.el (plstore-revert): New function.
+ (plstore-open): Use it; hide the buffer from user.
+
2011-06-30 Daiki Ueno <ueno@unixuser.org>
* auth-source.el (auth-source-backend): New member "arg".
nil ;secret plist (plist)
nil ;merged plist (plist)
)))
- (with-current-buffer (plstore--get-buffer store)
- (goto-char (point-min))
- (when (looking-at ";;; public entries\n")
- (forward-line)
- (plstore--set-alist store (read (point-marker)))
- (forward-sexp)
- (forward-char)
- (when (looking-at ";;; secret entries\n")
- (forward-line)
- (plstore--set-encrypted-data store (read (point-marker))))
- (plstore--merge-secret store)))
+ (plstore-revert store)
store))
+(defun plstore-revert (plstore)
+ "Replace current data in PLSTORE with the file on disk."
+ (with-current-buffer (plstore--get-buffer plstore)
+ ;; make the buffer invisible from user
+ (rename-buffer (format " plstore %s" (buffer-file-name)))
+ (goto-char (point-min))
+ (when (looking-at ";;; public entries\n")
+ (forward-line)
+ (plstore--set-alist plstore (read (point-marker)))
+ (forward-sexp)
+ (forward-char)
+ (when (looking-at ";;; secret entries\n")
+ (forward-line)
+ (plstore--set-encrypted-data plstore (read (point-marker))))
+ (plstore--merge-secret plstore))))
+
(defun plstore-close (plstore)
"Destroy a plstore instance PLSTORE."
(kill-buffer (plstore--get-buffer plstore)))