Function: erc-display-msg

erc-display-msg is a byte-compiled function defined in erc.el.gz.

Signature

(erc-display-msg LINE)

Documentation

Insert LINE into current buffer and run "send" hooks.

Treat LINE as input submitted interactively at the prompt, such as outgoing chat messages and echoed slash commands.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-display-msg (line)
  "Insert LINE into current buffer and run \"send\" hooks.
Treat LINE as input submitted interactively at the prompt, such
as outgoing chat messages and echoed slash commands."
  (when erc-insert-this
    (save-excursion
      (erc--assert-input-bounds)
      (let ((insert-position (marker-position (goto-char erc-insert-marker)))
            (erc--msg-props (or erc--msg-props
                                (let ((ovs (seq-filter
                                            #'cdr erc--msg-prop-overrides)))
                                  (map-into `((erc--msg . msg) ,@(reverse ovs))
                                            'hash-table)))))
        (insert (erc--format-speaker-input-message line) "\n")
        (save-restriction
          (narrow-to-region insert-position (point))
          (run-hooks 'erc-send-modify-hook)
          (run-hooks 'erc-send-post-hook)
          (cl-assert (> (- (point-max) (point-min)) 1))
          (add-text-properties (point-min) (1+ (point-min))
                               (erc--order-text-properties-from-hash
                                erc--msg-props)))
        (erc--refresh-prompt)))))