[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon da0e348bc7 61/63: Revert "multisession var in -to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon da0e348bc7 61/63: Revert "multisession var in -toot.el" |
Date: |
Sun, 4 Aug 2024 04:00:44 -0400 (EDT) |
branch: elpa/mastodon
commit da0e348bc7aaa48474da8cf0ee657fed3f5e485d
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
Revert "multisession var in -toot.el"
This reverts commit 00ac9103adba722f8c2ddbd67db6b0ff6bcebc46.
---
lisp/mastodon-toot.el | 50 +++++++++++++++++++++-----------------------------
1 file changed, 21 insertions(+), 29 deletions(-)
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 6387beae17..7497429595 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -40,6 +40,7 @@
(defvar emojify-user-emojis)
(require 'cl-lib)
+(require 'persist)
(require 'mastodon-iso)
(require 'facemenu)
(require 'text-property-search)
@@ -222,8 +223,8 @@ Takes its form from `window-configuration-to-register'.")
(defvar mastodon-toot-current-toot-text nil
"The text of the toot being composed.")
-(define-multisession-variable mastodon-toot-draft-toots-list nil
- "A list of toots that have been saved as drafts.
+(persist-defvar mastodon-toot-draft-toots-list nil
+ "A list of toots that have been saved as drafts.
For the moment we just put all composed toots in here, as we want
to also capture toots that are \"sent\" but that don't successfully
send.")
@@ -713,10 +714,8 @@ CANCEL means the toot was not sent, so we save the toot
text as a draft."
(let ((prev-window-config mastodon-toot-previous-window-config))
(unless (eq mastodon-toot-current-toot-text nil)
(when cancel
- (setf (multisession-value mastodon-toot-draft-toots-list)
- (cl-pushnew mastodon-toot-current-toot-text
- (multisession-value mastodon-toot-draft-toots-list)
- :test 'equal))))
+ (cl-pushnew mastodon-toot-current-toot-text
+ mastodon-toot-draft-toots-list :test 'equal)))
;; prevent some weird bug when cancelling a non-empty toot:
(delete #'mastodon-toot--save-toot-text after-change-functions)
(quit-window 'kill)
@@ -738,10 +737,8 @@ Pushes `mastodon-toot-current-toot-text' to
`mastodon-toot-draft-toots-list'."
(interactive)
(unless (eq mastodon-toot-current-toot-text nil)
- (setf (multisession-value mastodon-toot-draft-toots-list)
- (cl-pushnew mastodon-toot-current-toot-text
- (multisession-value mastodon-toot-draft-toots-list)
- :test 'equal))
+ (cl-pushnew mastodon-toot-current-toot-text
+ mastodon-toot-draft-toots-list :test 'equal)
(message "Draft saved!")))
(defun mastodon-toot--empty-p (&optional text-only)
@@ -1825,18 +1822,16 @@ Added to `after-change-functions' in new toot buffers."
(defun mastodon-toot--open-draft-toot ()
"Prompt for a draft and compose a toot with it."
(interactive)
- (if (multisession-value mastodon-toot-draft-toots-list)
- (let ((text (completing-read
- "Select draft toot: "
- (multisession-value mastodon-toot-draft-toots-list)
- nil t)))
+ (if mastodon-toot-draft-toots-list
+ (let ((text (completing-read "Select draft toot: "
+ mastodon-toot-draft-toots-list
+ nil t)))
(if (not (mastodon-toot--compose-buffer-p))
(mastodon-toot--compose-buffer nil nil nil text)
(when (and (not (mastodon-toot--empty-p :text-only))
(y-or-n-p "Replace current text with draft?"))
- (setf (multisession-value mastodon-toot-draft-toots-list)
- (cl-pushnew mastodon-toot-current-toot-text
- (multisession-value
mastodon-toot-draft-toots-list)))
+ (cl-pushnew mastodon-toot-current-toot-text
+ mastodon-toot-draft-toots-list)
(goto-char
(cdr (mastodon-tl--find-property-range 'toot-post-header
(point-min))))
@@ -1851,22 +1846,19 @@ Added to `after-change-functions' in new toot buffers."
(defun mastodon-toot--delete-draft-toot ()
"Prompt for a draft toot and delete it."
(interactive)
- (if (not (multisession-value mastodon-toot-draft-toots-list))
- (message "No drafts to delete.")
- (let ((draft (completing-read
- "Select draft to delete: "
- (multisession-value mastodon-toot-draft-toots-list)
- nil t)))
- (setf (multisession-value mastodon-toot-draft-toots-list)
- (cl-delete draft
- (multisession-value mastodon-toot-draft-toots-list)
- :test #'equal))
+ (if (not mastodon-toot-draft-toots-list)
+ (user-error "No drafts to delete")
+ (let ((draft (completing-read "Select draft to delete: "
+ mastodon-toot-draft-toots-list
+ nil t)))
+ (setq mastodon-toot-draft-toots-list
+ (cl-delete draft mastodon-toot-draft-toots-list :test #'equal))
(message "Draft deleted!"))))
(defun mastodon-toot--delete-all-drafts ()
"Delete all drafts."
(interactive)
- (setf (multisession-value mastodon-toot-draft-toots-list) nil)
+ (setq mastodon-toot-draft-toots-list nil)
(message "All drafts deleted!"))
- [nongnu] elpa/mastodon 0cd77c1880 37/63: Merge branch 'with-toot-item' into develop, (continued)
- [nongnu] elpa/mastodon 0cd77c1880 37/63: Merge branch 'with-toot-item' into develop, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 82931c0869 14/63: readme, emoji, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 4e8d286164 12/63: mastodon-use-emojify customize, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 4697c073e8 19/63: message -> user-error, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 344da8f2f2 23/63: fold toots customize/ refactor, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon db227a8c25 31/63: flip an if clause, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 4844a1147a 44/63: no newline after READ MORE heading, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon dd1b0ab770 42/63: add mastodon-tl--fold-post, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 30b02296ca 48/63: fix where we leave point on (un)folding, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 8d6983667d 51/63: refactor toot--toggle-bookmark, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon da0e348bc7 61/63: Revert "multisession var in -toot.el",
ELPA Syncer <=
- [nongnu] elpa/mastodon 45903de823 63/63: info update, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 3f9b305b5f 24/63: flymake, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon bb1b33e2fb 39/63: toot.el: use mastodon-toot--base-toot-or-item-json, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon e66ce7b6fb 52/63: folding comments / action docstring, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 4ac5b57ae6 62/63: Merge branch 'develop', ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon f8ee682bb4 36/63: flip an if clause, ELPA Syncer, 2024/08/04
- [nongnu] elpa/mastodon 5621b2df84 56/63: add underscores to user-like url regexes, ELPA Syncer, 2024/08/04