Function: activities-tabs-mode
activities-tabs-mode is an autoloaded, interactive and byte-compiled
function defined in activities-tabs.el.
Signature
(activities-tabs-mode &optional ARG)
Documentation
Integrate Activities with tab-bar-mode(var)/tab-bar-mode(fun).
When active, activities are opened in new tabs and named accordingly.
This is a global minor mode. If called interactively, toggle the
Activities-Tabs mode mode. If the prefix argument is positive, enable
the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate (default-value \=activities-tabs-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/activities-0.7.2/activities-tabs.el
;;;; Mode
;;;###autoload
(define-minor-mode activities-tabs-mode
"Integrate Activities with `tab-bar-mode'.
When active, activities are opened in new tabs and named
accordingly."
:global t
:group 'activities
(let ((override-map '((activities-activity-active-p . activities-tabs-activity-active-p)
(activities--set . activities-tabs-activity--set)
(activities--switch . activities-tabs--switch)
(activities-current . activities-tabs-current)
(activities-close . activities-tabs-close)
(activities-switch-buffer . activities-tabs--switch-buffer))))
(if activities-tabs-mode
(progn
(tab-bar-mode 1)
(add-hook 'window-configuration-change-hook #'activities-tabs--window-configuration-change)
(advice-add #'activities-resume :before #'activities-tabs-before-resume)
(pcase-dolist (`(,symbol . ,function) override-map)
(advice-add symbol :override function))
;; The mode command could be called to activate the mode
;; when it already is, in which case we must not swap the
;; tab-face-function again, which would discard the actual,
;; original value. (IOW, this must be idempotent.)
;; TODO: A way to prevent modes' body forms from being
;; reevaluated when they are already active.
(unless activities-tabs-tab-bar-tab-face-function-original
(setf activities-tabs-tab-bar-tab-face-function-original tab-bar-tab-face-function
tab-bar-tab-face-function #'activities-tabs--tab-bar-tab-face-function)))
(remove-hook 'window-configuration-change-hook #'activities-tabs--window-configuration-change)
(advice-remove #'activities-resume #'activities-tabs-before-resume)
(pcase-dolist (`(,symbol . ,function) override-map)
(advice-remove symbol function))
(when activities-tabs-tab-bar-tab-face-function-original
(setf tab-bar-tab-face-function activities-tabs-tab-bar-tab-face-function-original
activities-tabs-tab-bar-tab-face-function-original nil)))))