properties encountered in the wild may be combinations of faces rather
than lone ones.
+*** 'erc-flood-protect' no longer influences input splitting.
+This variable's role has been narrowed to rate limiting only. ERC
+used to suppress protocol line-splitting when its value was nil, but
+that's now handled by setting 'erc-split-line-length' to zero.
+
*** 'erc-pre-send-functions' visits prompt input post-split.
ERC now adjusts input lines to fall within allowed length limits
before showing hook members the result. For compatibility,
(defcustom erc-split-line-length 440
"The maximum length of a single message.
-If a message exceeds this size, it is broken into multiple ones.
+ERC normally splits chat input submitted at its prompt into
+multiple messages when the initial size exceeds this value in
+bytes. Modules can tell ERC to forgo splitting entirely by
+setting this to zero locally or, preferably, by binding it around
+a remapped `erc-send-current-line' command.
IRC allows for lines up to 512 bytes. Two of them are CR LF.
And a typical message looks like this:
(if (= (car cmp) (point-min))
(goto-char (nth 1 cmp))
(goto-char (car cmp)))))
- (cl-assert (/= (point-min) (point)))
+ (when (= (point-min) (point))
+ (goto-char (point-max)))
(push (buffer-substring-no-properties (point-min) (point)) out)
(delete-region (point-min) (point)))
(or (nreverse out) (list "")))
"Partition non-command input into lines of protocol-compliant length."
;; Prior to ERC 5.6, line splitting used to be predicated on
;; `erc-flood-protect' being non-nil.
- (unless (erc--input-split-cmdp state)
+ (unless (or (zerop erc-split-line-length) (erc--input-split-cmdp state))
(setf (erc--input-split-lines state)
(mapcan #'erc--split-line (erc--input-split-lines state)))))
(should-not erc-debug-irc-protocol)))
(ert-deftest erc--split-line ()
+ (let ((erc-split-line-length 0))
+ (should (equal (erc--split-line "") '("")))
+ (should (equal (erc--split-line " ") '(" ")))
+ (should (equal (erc--split-line "1") '("1")))
+ (should (equal (erc--split-line " 1") '(" 1")))
+ (should (equal (erc--split-line "1 ") '("1 ")))
+ (should (equal (erc--split-line "abc") '("abc"))))
+
(let ((erc-default-recipients '("#chan"))
(erc-split-line-length 10))
(should (equal (erc--split-line "") '("")))