Function: erc-cmd-CLEAR

erc-cmd-CLEAR is a byte-compiled function defined in erc.el.gz.

Signature

(erc-cmd-CLEAR)

Documentation

Clear messages in current buffer after informing active modules.

Expect modules to perform housekeeping tasks to withstand the disruption. When called from Lisp code, only clear messages up to but not including the one occupying the current line.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-cmd-CLEAR ()
  "Clear messages in current buffer after informing active modules.
Expect modules to perform housekeeping tasks to withstand the
disruption.  When called from Lisp code, only clear messages up
to but not including the one occupying the current line."
  (when erc--inhibit-clear-p
    (user-error "Truncation currently inhibited"))
  (with-silent-modifications
    (let ((end (copy-marker
                ;; Leave a final newline for compatibility, even though
                ;; it complicates `erc--clear-function' handling.
                (cond ((>= (point) erc-insert-marker)
                       (max (point-min) (1- erc-insert-marker)))
                      ((erc--get-inserted-msg-beg (point)))
                      ((pos-bol)))))
          (beg (point-min-marker)))
      (let ((erc--inhibit-clear-p t))
        (funcall erc--clear-function beg end))
      (set-marker beg nil)
      (set-marker end nil)))
  t)