Function: erc-truncate-mode
erc-truncate-mode is an autoloaded, interactive and byte-compiled
function defined in erc-truncate.el.gz.
Signature
(erc-truncate-mode &optional ARG)
Documentation
Toggle ERC truncate mode.
If called interactively, enable erc-truncate-mode(var)/erc-truncate-mode(fun) if ARG is
positive, and disable it otherwise. If called from Lisp, enable
the mode if ARG is omitted or nil.
Truncate a query buffer if it gets too large. This prevents the query buffer from getting too large, which can bring any grown Emacs to its knees after a few days worth of tracking heavy-traffic channels.
Before ERC 5.6, this module performed logging whenever the \+log
module's library, \+erc-log, happened to be loaded, regardless of
whether the \+log module itself was enabled. (Loading can of course
happen in any number of ways, such as when browsing options via
M-x customize-group (customize-group) or completing autoloaded symbol names at the
C-h v (describe-variable) prompt.) Users of \+truncate who prefer the
old behavior can add \+log to erc-modules to get the same effect.
Those who don't want logging but need to load the \+erc-log library
for other purposes should customize either erc-enable-logging or
erc-log-channels-directory to avoid the annoying warning.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-truncate.el.gz
;;;###autoload(autoload 'erc-truncate-mode "erc-truncate" nil t)
(define-erc-module truncate nil
"Truncate a query buffer if it gets too large.
This prevents the query buffer from getting too large, which can
bring any grown Emacs to its knees after a few days worth of
tracking heavy-traffic channels.
Before ERC 5.6, this module performed logging whenever the \\+`log'
module's library, \\+`erc-log', happened to be loaded, regardless of
whether the \\+`log' module itself was enabled. (Loading can of course
happen in any number of ways, such as when browsing options via
\\[customize-group] or completing autoloaded symbol names at the
\\[describe-variable] prompt.) Users of \\+`truncate' who prefer the
old behavior can add \\+`log' to `erc-modules' to get the same effect.
Those who don't want logging but need to load the \\+`erc-log' library
for other purposes should customize either `erc-enable-logging' or
`erc-log-channels-directory' to avoid the annoying warning."
;;enable
((add-hook 'erc-insert-done-hook #'erc-truncate-buffer)
(add-hook 'erc-connect-pre-hook #'erc-truncate--warn-about-logging)
(add-hook 'erc-mode-hook #'erc-truncate--setup)
(unless erc--updating-modules-p (erc-buffer-do #'erc-truncate--setup)))
;; disable
((remove-hook 'erc-insert-done-hook #'erc-truncate-buffer)
(remove-hook 'erc-connect-pre-hook #'erc-truncate--warn-about-logging)
(remove-hook 'erc-mode-hook #'erc-truncate--setup)
(erc-buffer-do #'erc-truncate--setup)))