diff options
Diffstat (limited to 'lisp/gnus/plstore.el')
-rw-r--r-- | lisp/gnus/plstore.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/gnus/plstore.el b/lisp/gnus/plstore.el index 3aa3b84fcbc..703943934e8 100644 --- a/lisp/gnus/plstore.el +++ b/lisp/gnus/plstore.el @@ -117,19 +117,25 @@ 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))) |