Fix error in ERC when 'erc-server-coding-system' is customized

* lisp/erc/erc-backend.el (erc-split-line): Handle the case where
'erc-coding-system-for-target' returns a coding-system's symbol.
(Bug#40914)
This commit is contained in:
Eli Zaretskii 2020-04-28 20:22:50 +03:00
parent 16fed05ba8
commit d83cc05a73

View file

@ -466,7 +466,8 @@ If this is set to nil, never try to reconnect."
The length is specified in `erc-split-line-length'.
Currently this is called by `erc-send-input'."
(let ((charset (car (erc-coding-system-for-target nil))))
(let* ((coding (erc-coding-system-for-target nil))
(charset (if (consp coding) (car coding) coding)))
(with-temp-buffer
(insert longline)
;; The line lengths are in octets, not characters (because these