[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/activities 48b6a783d1 3/4: Change: (activities-save) Al
From: |
ELPA Syncer |
Subject: |
[elpa] externals/activities 48b6a783d1 3/4: Change: (activities-save) Always set value, etc. |
Date: |
Thu, 8 Feb 2024 12:57:32 -0500 (EST) |
branch: externals/activities
commit 48b6a783d115dc9cf402afe64aa9e1d11879706b
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Change: (activities-save) Always set value, etc.
---
activities.el | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/activities.el b/activities.el
index b15575f0c4..daa12ea597 100644
--- a/activities.el
+++ b/activities.el
@@ -415,17 +415,16 @@ To be called from `kill-emacs-hook'."
If DEFAULTP, save its default state; if LASTP, its last. If
PERSISTP, force persisting of data (otherwise, data is persisted
according to option `activities-always-persist', which see)."
- (unless (or defaultp lastp)
- (user-error "Neither DEFAULTP nor LASTP specified"))
(activities-with activity
- ;; Don't try to save if a minibuffer is active, because we
- ;; wouldn't want to try to restore that layout.
- (unless (run-hook-with-args-until-success 'activities-anti-save-predicates)
- (pcase-let* (((cl-struct activities-activity name default last) activity)
- (new-state (activities-state)))
- (setf (activities-activity-default activity) (if (or defaultp (not
default)) new-state default)
- (activities-activity-last activity) (if (or lastp (not last))
new-state last)
- (map-elt activities-activities name) activity))))
+ (when (or defaultp lastp)
+ (unless (run-hook-with-args-until-success
'activities-anti-save-predicates)
+ (pcase-let* (((cl-struct activities-activity default last) activity)
+ (new-state (activities-state)))
+ (setf (activities-activity-default activity) (if (or defaultp (not
default)) new-state default)
+ (activities-activity-last activity) (if (or lastp (not last))
new-state last)))))
+ ;; Always set the value so, e.g. the activity can be modified
+ ;; externally and saved here.
+ (setf (map-elt activities-activities (activities-activity-name activity))
activity))
(activities--persist persistp))
(cl-defun activities-set (activity &key (state 'last))