Function: rcirc-send-string

rcirc-send-string is a byte-compiled function defined in rcirc.el.gz.

Signature

(rcirc-send-string PROCESS &rest PARTS)

Documentation

Send PROCESS a PARTS plus a newline.

PARTS may contain a : symbol, to designate that the next string is the message, that should be prefixed by a colon. If the last element in PARTS is a list, append it to PARTS.

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/net/rcirc.el.gz
(defun rcirc-send-string (process &rest parts)
  "Send PROCESS a PARTS plus a newline.
PARTS may contain a `:' symbol, to designate that the next string
is the message, that should be prefixed by a colon.  If the last
element in PARTS is a list, append it to PARTS."
  (let ((last (car (last parts))))
    (when (listp last)
      (setf parts (append (butlast parts) last))))
  (when-let* ((message (memq : parts)))
    (cl-check-type (cadr message) string)
    (setf (cadr message) (concat ":" (cadr message))
          parts (remq : parts)))
  (let ((string (concat (encode-coding-string
                         (mapconcat #'identity parts " ")
                         rcirc-encode-coding-system)
                        "\n")))
    (unless (rcirc--connection-open-p process)
      (signal 'rcirc-closed-connection process))
    (rcirc-debug process string)
    (process-send-string process string)))