Variable: erc-button--phantom-users-mode-hook

erc-button--phantom-users-mode-hook is a customizable variable defined in erc-button.el.gz.

Value

nil

Documentation

Hook run after entering or leaving erc-button--phantom-users-mode(var)/erc-button--phantom-users-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-button.el.gz
(define-minor-mode erc-button--phantom-users-mode
  "Minor mode to recognize unknown speakers.
Expect to be used by module setup code for creating placeholder
users on the fly during history playback.  Treat an unknown
\"PRIVMSG\" speaker, like \"<bob>\", as if they previously
appeared in a prior \"353\" message and are thus a known member
of the channel.  However, don't bother creating an actual
`erc-channel-user' object because their status prefix is unknown.
Instead, just spoof an `erc-server-user' and stash it during
\"PRIVMSG\" handling via `erc--cmem-from-nick-function' and
retrieve it during buttonizing via
`erc-button--fallback-cmem-function'."
  :interactive nil
  (if erc-button--phantom-users-mode
      (progn
        (add-function :after-until (local 'erc--cmem-from-nick-function)
                      #'erc-button--add-phantom-speaker '((depth . 30)))
        (add-function :after-until (local 'erc-button--fallback-cmem-function)
                      #'erc-button--get-phantom-cmem '((depth . 50)))
        (setq erc-button--phantom-cmems (make-hash-table :test #'equal)))
    (remove-function (local 'erc--cmem-from-nick-function)
                     #'erc-button--add-phantom-speaker)
    (remove-function (local 'erc-button--fallback-cmem-function)
                     #'erc-button--get-phantom-cmem)
    (kill-local-variable 'erc-button--phantom-cmems)))