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

Ensure last line of STATE's string is non-null.

But only when erc-send-whitespace-lines is non-nil. STATE is an erc--input-split object.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--discard-trailing-multiline-nulls (state)
  "Ensure last line of STATE's string is non-null.
But only when `erc-send-whitespace-lines' is non-nil.  STATE is
an `erc--input-split' object."
  (when (and erc-send-whitespace-lines (erc--input-split-lines state))
    (let ((reversed (nreverse (erc--input-split-lines state))))
      (when (string-empty-p (car reversed))
        (pop reversed)
        (setf (erc--input-split-cmdp state) nil))
      (nreverse (seq-drop-while #'string-empty-p reversed)))))