Variable: erc-bufbar-mode-hook

erc-bufbar-mode-hook is a customizable variable defined in erc-status-sidebar.el.gz.

Value

nil

Documentation

Hook run after entering or leaving erc-bufbar-mode(var)/erc-bufbar-mode(fun).

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-status-sidebar.el.gz
;;;###autoload(autoload 'erc-bufbar-mode "erc-status-sidebar" nil t)
(define-erc-module bufbar nil
  "Show `erc-track'-like activity in a side window.
When enabling, show the sidebar immediately in the current frame
if called from a connected ERC buffer.  Otherwise, arrange for
doing so on connect or whenever next displaying a new ERC buffer.
When disabling, hide the status window in all frames.  With a
negative prefix arg, also shutdown the session.  Normally, this
module only allows one sidebar window in an Emacs session.  To
override this, use `erc-status-sidebar-open' to force creation
and `erc-status-sidebar-close' to hide a single instance on the
current frame only."
  ((unless erc-track-mode
     (unless (memq 'track erc-modules)
       (erc--warn-once-before-connect 'erc-bufbar-mode
         "Module `bufbar' needs global module `track'. Enabling now."
         " This will affect \C-]all\C-] ERC sessions."
         " Add `track' to `erc-modules' to silence this message."))
     (erc-track-mode +1))
   (add-hook 'erc--setup-buffer-hook #'erc-status-sidebar--open)
   ;; Preserve side-window dimensions after `custom-buffer-done'.
   (when-let (((not erc--updating-modules-p))
              (buf (or (and (derived-mode-p 'erc-mode) (current-buffer))
                       (car (erc-buffer-filter
                             (lambda () erc-server-connected))))))
     (with-current-buffer buf
       (erc-status-sidebar--open))))
  ((remove-hook 'erc--setup-buffer-hook #'erc-status-sidebar--open)
   (erc-status-sidebar-close 'all-frames)
   (when-let ((arg erc--module-toggle-prefix-arg)
              ((numberp arg))
              ((< arg 0)))
     (erc-status-sidebar-kill))))