File: activities.el.html
Inspired by Genera's and KDE's concepts of "activities", this
library allows the user to select an "activity", the loading of
which restores a window configuration into a tab-bar tab or
frame, along with the buffers shown in each window. Saving an
activity saves the state for later restoration. Switching away
from an activity saves the last-used state for later switching back
to, while still allowing the activity's initial or default state to
be restored on demand. Resuming an activity loads the last-used
state, or the initial/default state when a universal argument is
provided.
The implementation uses the bookmark system to save buffers' states--that is, any major mode that supports the bookmark system is compatible. A buffer whose major mode does not support the bookmark system (or does not support it well enough to restore useful state) is not compatible and can't be fully restored, or perhaps not at all; but solving that is as simple as implementing bookmark support for the mode, which is usually trivial.
Integration with Emacs's tab-bar-mode(var)/tab-bar-mode(fun) is provided: a window
configuration or can be restored to a tab-bar tab or to a frame.
Various hooks are provided, both globally and per-activity, so that the user can define functions to be called when an activity is saved, restored, or switched from/to. For example, this could be used to limit the set of buffers offered for switching to within an activity, or to track the time spent in an activity.
Defined variables (24)
activities-activities | FIXME: Docstring. |
activities-after-resume-functions | Functions called after resuming an activity. |
activities-after-switch-functions | Functions called after switching to an activity. |
activities-always-persist | Always persist activity states to disk when saving. |
activities-anti-kill-predicates | Predicates which prevent a buffer from being killed. |
activities-anti-save-predicates | Predicates which prevent an activity’s state from being saved. |
activities-before-resume-functions | Functions called before resuming an activity. |
activities-bookmark-name-prefix | Prefix for activity bookmark names. |
activities-bookmark-store | Store a bookmark when making a new activity. |
activities-bookmark-warnings | Warn when a buffer can’t be bookmarked. |
activities-buffer-local-variables | Variables whose value are saved and restored by activities. |
activities-completing-read-history | History for ‘activities-completing-read’. |
activities-default-name-fn | Function that returns the default name for a new activity. |
activities-kill-buffers | Kill buffers when suspending an activity. |
activities-mode | Non-nil if Activities mode is enabled. |
activities-mode-hook | Hook run after entering or leaving ‘activities-mode’. |
activities-mode-idle-frequency | Automatically save activities when Emacs has been idle this many seconds. |
activities-mode-timer | Automatically saves activities according to ‘activities-mode-idle-frequency’. |
activities-name-prefix | Prefix applied to activity names in frames/tabs. |
activities-resume-into-frame | Which frame to resume an activity into. |
activities-saving-p | Non-nil when saving activities’ states. |
activities-set-frame-name | Set frame name after switching activity. |
activities-window-parameters-translators | Functions used to serialize and deserialize certain window parameters. |
activities-window-persistent-parameters | Additional window parameters to persist. |