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

erc-button--phantom-users-mode is a buffer-local variable defined in erc-button.el.gz.

Documentation

Non-nil if Erc-Button--Phantom-Users mode is enabled.

Use the command erc-button--phantom-users-mode(var)/erc-button--phantom-users-mode(fun) to change this variable.

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)))