Skip to content

Commit

Permalink
Add: (activities-saving-p) And don't raise-frame when saving
Browse files Browse the repository at this point in the history
See #4.

Reported-by: JD Smith <https://github.com/jdtsmith>
  • Loading branch information
alphapapa committed Feb 2, 2024
1 parent f5acaaf commit 31bd841
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ When option ~activities-bookmark-store~ is enabled, an Emacs bookmark is stored
*Fixes*
+ Don't save activity state if a minibuffer is active.
+ Offer only active activities for suspending.
+ Don't raise frame when saving activity states. (See [[https://github.com/alphapapa/activities.el/issues/4][#4]]. Thanks to [[https://github.com/jdtsmith][JD Smith]] for reporting.)

** v0.3.3

Expand Down
12 changes: 10 additions & 2 deletions activities.el
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ For example, the value of `window-preserved-size' includes a
buffer, which must be serialized to a buffer name, and then
deserialized back to the buffer after it is reincarnated.")

(defvar activities-saving-p nil
"Non-nil when saving activities' states.")

;;;; Customization

(defgroup activities nil
Expand Down Expand Up @@ -348,7 +351,8 @@ In order to be safe for `kill-emacs-hook', this demotes errors."
(interactive)
(with-demoted-errors "activities-save-all: ERROR: %S"
(dolist (activity (cl-remove-if-not #'activities-activity-active-p (map-values activities-activities)))
(activities-save activity :lastp t))))
(let ((activities-saving-p t))
(activities-save activity :lastp t)))))

(defun activities-revert (activity)
"Reset ACTIVITY to its default state."
Expand Down Expand Up @@ -473,7 +477,11 @@ Select's ACTIVITY's frame, making a new one if needed. Its state
is not changed."
(select-frame (or (activities--frame activity)
(make-frame `((activity . ,activity)))))
(raise-frame)
(unless activities-saving-p
;; HACK: Don't raise the frame when saving the activity's state.
;; (I don't love this solution, largely because it only applies
;; when not using `activities-tabs-mode', but it will do for now.)
(raise-frame))
(set-frame-name (activities-name-for activity)))

(defun activities--frame (activity)
Expand Down
25 changes: 14 additions & 11 deletions activities.info
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ File: README.info, Node: v04-pre, Next: v033, Up: Changelog
*Fixes*
• Don’t save activity state if a minibuffer is active.
• Offer only active activities for suspending.
• Don’t raise frame when saving activity states. (See #4
(https://github.com/alphapapa/activities.el/issues/4). Thanks to
JD Smith (https://github.com/jdtsmith) for reporting.)


File: README.info, Node: v033, Next: v032, Prev: v04-pre, Up: Changelog
Expand Down Expand Up @@ -524,17 +527,17 @@ Node: Bookmarks9166
Node: FAQ9518
Node: Changelog12594
Node: v04-pre12866
Node: v03313211
Node: v03213645
Node: v03113773
Node: v0314103
Node: v0214493
Node: v01314985
Node: v01215134
Node: v01115311
Node: v0115474
Node: Development15575
Node: Copyright assignment15847
Node: v03313407
Node: v03213841
Node: v03113969
Node: v0314299
Node: v0214689
Node: v01315181
Node: v01215330
Node: v01115507
Node: v0115670
Node: Development15771
Node: Copyright assignment16043

End Tag Table

Expand Down

0 comments on commit 31bd841

Please sign in to comment.