Function: erc--discard-trailing-multiline-nulls

erc--discard-trailing-multiline-nulls is a byte-compiled function defined in erc.el.gz.

Signature

(erc--discard-trailing-multiline-nulls STATE)

Documentation

Remove trailing empty lines from STATE, an erc--input-split object.

When all lines are empty, remove all but the first.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--discard-trailing-multiline-nulls (state)
  "Remove trailing empty lines from STATE, an `erc--input-split' object.
When all lines are empty, remove all but the first."
  (when (erc--input-split-lines state)
    (let ((reversed (nreverse (erc--input-split-lines state))))
      (while (and (cdr reversed) (string-empty-p (car reversed)))
        (setq reversed (cdr reversed)))
      (setf (erc--input-split-lines state) (nreverse reversed)))))