[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/activities c9f2c57d58 2/2: Fix: (activities-save) Don't
From: |
ELPA Syncer |
Subject: |
[elpa] externals/activities c9f2c57d58 2/2: Fix: (activities-save) Don't save if minibuffer is active |
Date: |
Wed, 31 Jan 2024 06:57:23 -0500 (EST) |
branch: externals/activities
commit c9f2c57d58e688329621df8c2c5fb17d1d37a2c9
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Fix: (activities-save) Don't save if minibuffer is active
---
README.org | 3 ++-
activities.el | 13 ++++++++-----
activities.info | 25 +++++++++++++------------
3 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/README.org b/README.org
index 875a1f1e1e..af07432bd2 100644
--- a/README.org
+++ b/README.org
@@ -131,7 +131,8 @@ When option ~activities-bookmark-store~ is enabled, an
Emacs bookmark is stored
** v0.4-pre
-Nothing new yet.
+*Fixes*
++ Don't save activity state if a minibuffer is active.
** v0.3.3
diff --git a/activities.el b/activities.el
index 10e238965e..00a99942f4 100644
--- a/activities.el
+++ b/activities.el
@@ -405,11 +405,14 @@ according to option `activities-always-persist', which
see)."
(unless (or defaultp lastp)
(user-error "Neither DEFAULTP nor LASTP specified"))
(activities-with activity
- (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)))
+ ;; Don't try to save if a minibuffer is active, because we
+ ;; wouldn't want to try to restore that layout.
+ (unless (active-minibuffer-window)
+ (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))))
(activities--persist persistp))
(cl-defun activities-set (activity &key (state 'last))
diff --git a/activities.info b/activities.info
index 14c375c284..7759b6c89b 100644
--- a/activities.info
+++ b/activities.info
@@ -371,7 +371,8 @@ File: README.info, Node: v04-pre, Next: v033, Up:
Changelog
5.1 v0.4-pre
============
-Nothing new yet.
+*Fixes*
+ • Don’t save activity state if a minibuffer is active.
File: README.info, Node: v033, Next: v032, Prev: v04-pre, Up: Changelog
@@ -518,17 +519,17 @@ Node: Bookmarks9166
Node: FAQ9518
Node: Changelog12594
Node: v04-pre12866
-Node: v03312977
-Node: v03213411
-Node: v03113539
-Node: v0313869
-Node: v0214259
-Node: v01314751
-Node: v01214900
-Node: v01115077
-Node: v0115240
-Node: Development15341
-Node: Copyright assignment15613
+Node: v03313030
+Node: v03213464
+Node: v03113592
+Node: v0313922
+Node: v0214312
+Node: v01314804
+Node: v01214953
+Node: v01115130
+Node: v0115293
+Node: Development15394
+Node: Copyright assignment15666
End Tag Table