From 8e36abecbb8fa0df1aba30b1100130e5e382b92b Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Mon, 17 Jan 2022 19:40:59 +0530 Subject: introduce a general plstore reading function Introduce a general version of `mastodon-client--read'[1] with the name `mastodon-client--general-read'[2] as [1] is too specific. [2] can be called with with a plstore "key" to retrieve the item keyed by that KEY. --- lisp/mastodon-client.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 04a26ce..7a857a2 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -109,6 +109,13 @@ Make `mastodon-client--fetch' call to determine client values." (mastodon (plstore-get plstore (concat "mastodon-" mastodon-instance-url)))) (mastodon-client--remove-key-from-plstore mastodon))) +(defun mastodon-client--general-read (key) + "Retrieve the plstore item keyed by KEY. +Return plist without the KEY." + (let* ((plstore (plstore-open (mastodon-client--token-file))) + (plstore-item (plstore-get plstore key))) + (mastodon-client--remove-key-from-plstore plstore-item))) + (defun mastodon-client () "Return variable client secrets to use for `mastodon-instance-url'. -- cgit v1.2.3