Variable: erc-stamp--display-margin-mode
erc-stamp--display-margin-mode is a buffer-local variable defined in
erc-stamp.el.gz.
Documentation
Non-nil if Erc-Stamp--Display-Margin mode is enabled.
Use the command erc-stamp--display-margin-mode(var)/erc-stamp--display-margin-mode(fun) to change this
variable.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-stamp.el.gz
;; Currently, `erc-insert-timestamp-right' hard codes its display
;; property to use `right-margin', and `erc-insert-timestamp-left'
;; does the same for `left-margin'. However, there's no reason a
;; trailing stamp couldn't be displayed on the left and vice versa.
(define-minor-mode erc-stamp--display-margin-mode
"Internal minor mode for built-in modules integrating with `stamp'.
Arranges for displaying stamps in a single margin, with the
variable `erc-stamp--margin-left-p' controlling which one.
Provides `erc-stamp--margin-width' and `erc-stamp--adjust-margin'
to help manage the chosen margin's width. Also removes `display'
properties in killed text to reveal stamps. The invoking module
should set controlling variables, like `erc-stamp--margin-width'
and `erc-stamp--margin-left-p', before activating the mode."
:interactive nil
(if erc-stamp--display-margin-mode
(progn
(setq fringes-outside-margins t)
(when (eq (current-buffer) (window-buffer))
(set-window-buffer (selected-window) (current-buffer)))
(setq erc-stamp--margin-left-p (and erc-stamp--margin-left-p t))
(if (or erc-server-connected (not (functionp erc-prompt)))
(erc-stamp--init-margins-on-connect)
(add-hook 'erc-after-connect
#'erc-stamp--init-margins-on-connect nil t))
(add-function :filter-return (local 'filter-buffer-substring-function)
#'erc--remove-text-properties)
(add-hook 'erc--setup-buffer-hook
#'erc-stamp--refresh-left-margin-prompt nil t)
(when (and erc-stamp--margin-left-p
(not erc-stamp--skip-left-margin-prompt-p))
(add-hook 'erc--refresh-prompt-hook
#'erc-stamp--display-prompt-in-left-margin nil t)))
(remove-function (local 'filter-buffer-substring-function)
#'erc--remove-text-properties)
(remove-hook 'erc-after-connect
#'erc-stamp--init-margins-on-connect t)
(remove-hook 'erc--refresh-prompt-hook
#'erc-stamp--display-prompt-in-left-margin t)
(remove-hook 'erc--setup-buffer-hook
#'erc-stamp--refresh-left-margin-prompt t)
(kill-local-variable (if erc-stamp--margin-left-p
'left-margin-width
'right-margin-width))
(kill-local-variable 'erc-stamp--skip-left-margin-prompt-p)
(kill-local-variable 'fringes-outside-margins)
(kill-local-variable 'erc-stamp--margin-left-p)
(kill-local-variable 'erc-stamp--margin-width)
(when (eq (current-buffer) (window-buffer))
(set-window-margins nil left-margin-width nil)
(set-window-buffer (selected-window) (current-buffer)))))