Function: erc-track-enable
erc-track-enable is an interactive and byte-compiled function defined
in erc-track.el.gz.
Signature
(erc-track-enable)
Documentation
Enable ERC track mode.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-track.el.gz
;;; Module
;;;###autoload(autoload 'erc-track-mode "erc-track" nil t)
(define-erc-module track nil
"This mode tracks ERC channel buffers with activity."
;; Enable:
((when (boundp 'erc-track-when-inactive)
(if erc-track-when-inactive
(progn
(add-hook 'window-configuration-change-hook #'erc-user-is-active)
(add-hook 'erc-send-completed-hook #'erc-user-is-active)
;; FIXME find out why this uses `erc-server-001-functions'.
;; `erc-user-is-active' runs when `erc-server-connected' is
;; non-nil. But this hook usually only runs when it's nil.
(add-hook 'erc-server-001-functions #'erc-user-is-active))
(erc-track-add-to-mode-line erc-track-position-in-mode-line)
(erc-update-mode-line)
(add-hook 'window-configuration-change-hook
#'erc-window-configuration-change)
(add-hook 'erc-insert-post-hook #'erc-track-modified-channels)
(add-hook 'erc-disconnected-hook #'erc-modified-channels-update))
;; enable the tracking keybindings
(add-hook 'erc-connect-pre-hook #'erc-track-minor-mode-maybe)
(erc-track-minor-mode-maybe))
(add-hook 'erc-mode-hook #'erc-track--setup)
(unless erc--updating-modules-p (erc-buffer-do #'erc-track--setup))
(add-hook 'erc-networks--copy-server-buffer-functions
#'erc-track--replace-killed-buffer))
;; Disable:
((when (boundp 'erc-track-when-inactive)
(erc-track-remove-from-mode-line)
(if erc-track-when-inactive
(progn
(remove-hook 'window-configuration-change-hook
#'erc-user-is-active)
(remove-hook 'erc-send-completed-hook #'erc-user-is-active)
(remove-hook 'erc-server-001-functions #'erc-user-is-active)
;; FIXME remove this if unused.
(remove-hook 'erc-timer-hook #'erc-user-is-active))
(remove-hook 'window-configuration-change-hook
#'erc-window-configuration-change)
(remove-hook 'erc-disconnected-hook #'erc-modified-channels-update)
(remove-hook 'erc-insert-post-hook #'erc-track-modified-channels))
;; disable the tracking keybindings
(remove-hook 'erc-connect-pre-hook #'erc-track-minor-mode-maybe)
(when erc-track-minor-mode
(erc-track-minor-mode -1)))
(remove-hook 'erc-mode-hook #'erc-track--setup)
(erc-buffer-do #'erc-track--setup)
(remove-hook 'erc-networks--copy-server-buffer-functions
#'erc-track--replace-killed-buffer)))