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-activitiesFIXME: Docstring.
activities-after-resume-functionsFunctions called after resuming an activity.
activities-after-switch-functionsFunctions called after switching to an activity.
activities-always-persistAlways persist activity states to disk when saving.
activities-anti-kill-predicatesPredicates which prevent a buffer from being killed.
activities-anti-save-predicatesPredicates which prevent an activity’s state from being saved.
activities-before-resume-functionsFunctions called before resuming an activity.
activities-bookmark-name-prefixPrefix for activity bookmark names.
activities-bookmark-storeStore a bookmark when making a new activity.
activities-bookmark-warningsWarn when a buffer can’t be bookmarked.
activities-buffer-local-variablesVariables whose value are saved and restored by activities.
activities-completing-read-historyHistory for ‘activities-completing-read’.
activities-default-name-fnFunction that returns the default name for a new activity.
activities-kill-buffersKill buffers when suspending an activity.
activities-modeNon-nil if Activities mode is enabled.
activities-mode-hookHook run after entering or leaving ‘activities-mode’.
activities-mode-idle-frequencyAutomatically save activities when Emacs has been idle this many seconds.
activities-mode-timerAutomatically saves activities according to ‘activities-mode-idle-frequency’.
activities-name-prefixPrefix applied to activity names in frames/tabs.
activities-resume-into-frameWhich frame to resume an activity into.
activities-saving-pNon-nil when saving activities’ states.
activities-set-frame-nameSet frame name after switching activity.
activities-window-parameters-translatorsFunctions used to serialize and deserialize certain window parameters.
activities-window-persistent-parametersAdditional window parameters to persist.

Defined functions (66)

activities--backtrace-visible-p()
activities--bookmark-buffer(STRUCT)
activities--buffer-local-variables(VARIABLES)
activities--bufferize-window-state(STATE)
activities--deserialize(ARG &rest ARGS)
activities--error-buffer(NAME STRINGS)
activities--filename-buffer(ACTIVITIES-BUFFER)
activities--frame(ACTIVITY)
activities--name-buffer(ACTIVITIES-BUFFER)
activities--window-serialized(STATE)
activities--window-state(FRAME)
activities--windows-set(STATE)
activities-activity-active-p(ACTIVITY)
activities-activity-default(CL-X)
activities-activity-etc--cmacro(CL-WHOLE-ARG CL-X)
activities-activity-last(CL-X)
activities-activity-name--cmacro(CL-WHOLE-ARG CL-X)
activities-activity-p(CL-X)
activities-activity-p--cmacro(CL-WHOLE-ARG CL-X)
activities-activity-state-etc--cmacro(CL-WHOLE-ARG CL-X)
activities-activity-state-p(CL-X)
activities-activity-state-window-state(CL-X)
activities-activity-state-window-state--cmacro(CL-WHOLE-ARG CL-X)
activities-bookmark-handler(BOOKMARK)
activities-bookmark-store(ACTIVITY)
activities-buffer-bookmark(CL-X)
activities-buffer-etc(CL-X)
activities-buffer-etc--cmacro(CL-WHOLE-ARG CL-X)
activities-buffer-filename--cmacro(CL-WHOLE-ARG CL-X)
activities-buffer-hidden-p(BUFFER)
activities-buffer-local-variables--cmacro(CL-WHOLE-ARG CL-X)
activities-buffer-name(CL-X)
activities-buffer-name--cmacro(CL-WHOLE-ARG CL-X)
activities-buffer-p(CL-X)
activities-buffer-p--cmacro(CL-WHOLE-ARG CL-X)
activities-buffer-special-p(BUFFER)
activities-close(ACTIVITY)
activities-completing-read
activities-current()
activities-debug(&rest ARGS)
activities-define
activities-discard(ACTIVITY)
activities-kill(ACTIVITY)
activities-mode(&optional ARG)
activities-mode--killing-emacs()
activities-name-for(ACTIVITY)
activities-names(&optional (ACTIVITIES activities-activities))
activities-new(NAME)
activities-rename(ACTIVITY NAME)
activities-resume
activities-revert(ACTIVITY)
activities-save
activities-save-all
activities-set
activities-state()
activities-suspend(ACTIVITY)
activities-switch-buffer(ACTIVITY)
activities-with(ACTIVITY &rest BODY)
activity--serialize(ARG &rest ARGS)
copy-activities-activity(ARG)
copy-activities-activity-state(ARG)
copy-activities-buffer(ARG)
make-activities-activity
make-activities-activity--cmacro
make-activities-activity-state--cmacro
make-activities-buffer--cmacro

Defined faces (0)