[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon f19f3bc273 08/63: replace persist with multisessi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon f19f3bc273 08/63: replace persist with multisession |
Date: |
Sun, 4 Aug 2024 04:00:29 -0400 (EDT) |
branch: elpa/mastodon
commit f19f3bc2735bd78bb3150b8507b6f8949108cece
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
replace persist with multisession
---
lisp/mastodon-profile.el | 19 +++++++++++--------
lisp/mastodon-toot.el | 4 +++-
lisp/mastodon.el | 2 +-
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index de16b7d216..cd1978fde1 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -35,7 +35,6 @@
;;; Code:
(require 'seq)
(require 'cl-lib)
-(require 'persist)
(require 'parse-time)
(require 'mastodon-http)
(eval-when-compile
@@ -125,8 +124,8 @@ It contains details of the current user's account.")
map)
"Keymap for `mastodon-profile-update-mode'.")
-(persist-defvar mastodon-profile-account-settings nil
- "An alist of account settings saved from the server.
+(define-multisession-variable mastodon-profile-account-settings nil
+ "An alist of account settings saved from the server.
Other clients can change these settings on the server at any
time, so this list is not the canonical source for settings. It
is updated on entering mastodon mode and on toggle any setting it
@@ -365,13 +364,16 @@ SOURCE means that the preference is in the `source' part
of the account JSON."
(defun mastodon-profile--get-pref (pref)
"Return PREF from `mastodon-profile-account-settings'."
- (plist-get mastodon-profile-account-settings pref))
+ (plist-get (multisession-value mastodon-profile-account-settings)
+ pref))
(defun mastodon-profile--update-preference-plist (pref val)
"Set local account preference plist preference PREF to VAL.
This is done after changing the setting on the server."
- (setq mastodon-profile-account-settings
- (plist-put mastodon-profile-account-settings pref val)))
+ (setf (multisession-value mastodon-profile-account-settings)
+ (plist-put
+ (multisession-value mastodon-profile-account-settings)
+ pref val)))
;; used in toot.el
(defun mastodon-profile--fetch-server-account-settings-maybe ()
@@ -384,7 +386,8 @@ Only do so if `mastodon-profile-account-settings' is nil."
Store the values in `mastodon-profile-account-settings'.
Run in `mastodon-mode-hook'.
If NO-FORCE, only fetch if `mastodon-profile-account-settings' is nil."
- (unless (and no-force mastodon-profile-account-settings)
+ (unless (and no-force
+ (multisession-value mastodon-profile-account-settings))
(let ((keys '(locked discoverable display_name bot))
(source-keys '(privacy sensitive language)))
(mapc (lambda (k)
@@ -402,7 +405,7 @@ If NO-FORCE, only fetch if
`mastodon-profile-account-settings' is nil."
;; TODO: remove now redundant vars, replace with fetchers from the plist
(setq mastodon-toot--visibility (mastodon-profile--get-pref 'privacy)
mastodon-toot--content-nsfw (mastodon-profile--get-pref
'sensitive))
- mastodon-profile-account-settings)))
+ (multisession-value mastodon-profile-account-settings))))
(defun mastodon-profile--account-locked-toggle ()
"Toggle the locked status of your account.
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e934352690..694d9c061f 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1964,7 +1964,9 @@ EDIT means we are editing an existing toot, not composing
a new one."
(mastodon-toot-mode t)
;; set visibility:
(setq mastodon-toot--visibility
- (or (plist-get mastodon-profile-account-settings 'privacy)
+ (or (plist-get
+ (multisession-value mastodon-profile-account-settings)
+ 'privacy)
;; use toot visibility setting from the server:
(mastodon-profile--get-source-value 'privacy)
"public")) ; fallback
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index d0dddeeb6f..0747d530b3 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -7,7 +7,7 @@
;; Marty Hiatt <martianhiatus@riseup.net>
;; Maintainer: Marty Hiatt <martianhiatus@riseup.net>
;; Version: 1.0.24
-;; Package-Requires: ((emacs "27.1") (request "0.3.0") (persist "0.4"))
+;; Package-Requires: ((emacs "27.1") (request "0.3.0"))
;; Homepage: https://codeberg.org/martianh/mastodon.el
;; This file is not part of GNU Emacs.
- [nongnu] elpa/mastodon 3eb1c4f794 41/63: --thread: diff name for option arg to avoid macro var, (continued)
- [nongnu] elpa/mastodon 3eb1c4f794 41/63: --thread: diff name for option arg to avoid macro var, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 028ab8ea22 43/63: fix newlines accumulating on (un)folding toots, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 134ec9413a 45/63: small adjustments to point placement with (un)folding, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon cf72fb5af0 47/63: bind fold toggle, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon d0a5bae331 50/63: refactor toot--toggle-boost-or-favourite, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon c75c4b7753 60/63: Revert "readme: multisession", ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 1887a2d414 11/63: readme: multisession, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon a9c6c04ac6 09/63: comments on mastodon-tl--goto-item-pos, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 4d335d45f4 16/63: index, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon a7fec25557 17/63: Merge branch 'multisession' into develop, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon f19f3bc273 08/63: replace persist with multisession,
ELPA Syncer <=
- [nongnu] elpa/mastodon c8565612b9 22/63: fold long posts, unfolding cmd. FIX #572., ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon d60d1d4c31 34/63: read CW when setting, not when sending, also display it. FIX #569., ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon d7816ab59f 35/63: add item-json prop to fave/boost strings, so (un)folding works, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon f16fcb15a8 27/63: use mastodon-use-emojify in toot.el, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 945de24d3e 57/63: Merge branch 'develop' into insert-status-for-fold, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 6b0a0eb1fa 49/63: readme, index, info, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 46b66e332a 58/63: commentary, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 7b4d77b86b 10/63: tl: no-refresh for next-item in --single-toot, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon b8e8328a35 04/63: use with-toot-item and clean up functions that use it, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 6721f40cfd 30/63: unfold toot: replace whole item on unfolding (so we have props!), ELPA Syncer, 2024/08/04