Skip to content

Commit

Permalink
Add: (activities-resume-into-frame)
Browse files Browse the repository at this point in the history
Closes #22.

Suggested-by: Icy-Thought <https://github.com/Icy-Thought>
  • Loading branch information
alphapapa committed Feb 11, 2024
1 parent 70e7304 commit c7150af
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ When option ~activities-bookmark-store~ is enabled, an Emacs bookmark is stored
*Additions*
+ Suggest setting variable ~edebug-inhibit-emacs-lisp-mode-bindings~ to avoid conflicts with suggested keybindings.
+ Option ~activities-bookmark-warnings~ enables warning messages when a non-file-visiting buffer can't be bookmarked (for debugging purposes).
+ Option ~activities-resume-into-frame~ controls whether resuming an activity opens a new frame or uses the current one (when ~activities-tabs-mode~ is disabled). ([[https://github.com/alphapapa/activities.el/issues/22][#22]]. Thanks to [[https://github.com/Icy-Thought][Icy-Thought]] for suggesting.)

*Changes*
+ Command ~activities-kill~ now discards an activity's last state (while ~activities-suspend~ saves its last state), and closes its frame or tab.
Expand Down
15 changes: 13 additions & 2 deletions activities.el
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ non-nil, the activity's state is not saved."
(function-item activities--backtrace-visible-p)
(function :tag "Other predicate")))

(defcustom activities-resume-into-frame 'current
"Which frame to resume an activity into.
Only applies when `activities-tabs-mode' is disabled."
:type '(choice (const :tag "Current frame"
:doc "Replace current frame's window configuration"
current)
(const :tag "New frame" :doc "Make a new frame" new)))

(defcustom activities-bookmark-warnings nil
"Warn when a buffer can't be bookmarked.
This is expected to be the case for non-file-visiting buffers
Expand Down Expand Up @@ -492,8 +500,11 @@ closed."
"Switch to ACTIVITY.
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)))))
(if (activities-activity-active-p activity)
(select-frame (activities--frame activity))
(pcase activities-resume-into-frame
('current nil)
('new (select-frame (make-frame `((activity . ,activity)))))))
(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
Expand Down
29 changes: 17 additions & 12 deletions activities.info
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@ File: README.info, Node: v05-pre, Next: v04, Up: Changelog
• Option ‘activities-bookmark-warnings’ enables warning messages when
a non-file-visiting buffer can’t be bookmarked (for debugging
purposes).
• Option ‘activities-resume-into-frame’ controls whether resuming an
activity opens a new frame or uses the current one (when
‘activities-tabs-mode’ is disabled). (#22
(https://github.com/alphapapa/activities.el/issues/22). Thanks to
Icy-Thought (https://github.com/Icy-Thought) for suggesting.)

*Changes*
• Command ‘activities-kill’ now discards an activity’s last state
Expand Down Expand Up @@ -588,18 +593,18 @@ Node: Bookmarks10053
Node: FAQ10405
Node: Changelog13481
Node: v05-pre13766
Node: v0415411
Node: v03315956
Node: v03216386
Node: v03116514
Node: v0316844
Node: v0217234
Node: v01317726
Node: v01217875
Node: v01118052
Node: v0118217
Node: Development18318
Node: Copyright assignment18590
Node: v0415742
Node: v03316287
Node: v03216717
Node: v03116845
Node: v0317175
Node: v0217565
Node: v01318057
Node: v01218206
Node: v01118383
Node: v0118548
Node: Development18649
Node: Copyright assignment18921

End Tag Table

Expand Down

0 comments on commit c7150af

Please sign in to comment.