Function: erc--check-prompt-input-for-multiline-blanks
erc--check-prompt-input-for-multiline-blanks is a byte-compiled
function defined in erc.el.gz.
Signature
(erc--check-prompt-input-for-multiline-blanks _ LINES)
Documentation
Return non-nil when multiline prompt input has blank LINES.
Consider newlines to be intervening delimiters, meaning the empty
"logical" line between a trailing newline and eob constitutes
a separate message.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--check-prompt-input-for-multiline-blanks (_ lines)
"Return non-nil when multiline prompt input has blank LINES.
Consider newlines to be intervening delimiters, meaning the empty
\"logical\" line between a trailing newline and `eob' constitutes
a separate message."
(pcase-let ((`(,total ,pad ,strip)(erc--count-blank-lines lines)))
(cond ((zerop total) nil)
((and erc-warn-about-blank-lines erc-send-whitespace-lines)
(let (msg args)
(unless (zerop strip)
(push "stripping (%d)" msg)
(push strip args))
(unless (zerop pad)
(when msg
(push "and" msg))
(push "padding (%d)" msg)
(push pad args))
(when msg
(push "blank" msg)
(push (if (> (apply #'+ args) 1) "lines" "line") msg))
(when msg
(setf msg (nreverse msg)
(car msg) (capitalize (car msg))))
(when msg
(push (apply #'format (string-join msg " ") (nreverse args))
erc--check-prompt-explanation)
nil)))
(erc-warn-about-blank-lines
(concat (if (= total 1)
(if (zerop strip) "Blank" "Trailing")
(if (= total strip)
(format "%d trailing" strip)
(format "%d blank" total)))
(and (> total 1) (/= total strip) (not (zerop strip))
(format " (%d trailing)" strip))
(if (= total 1) " line" " lines")
" detected (see `erc-send-whitespace-lines')"))
(erc-send-whitespace-lines nil)
(t 'invalid))))