Function: erc--command-indicator-display

erc--command-indicator-display is a byte-compiled function defined in erc-goodies.el.gz.

Signature

(erc--command-indicator-display LINE &rest REST)

Documentation

Insert command LINE as echoed input resembling that of REPLs and shells.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-goodies.el.gz
;; This function used to be called `erc-display-command'.  It was
;; neutered in ERC 5.3.x (Emacs 24.5), commented out in 5.4, removed
;; in 5.5, and restored in 5.6.
(defun erc--command-indicator-display (line &rest rest)
  "Insert command LINE as echoed input resembling that of REPLs and shells."
  (when erc-insert-this
    (when rest
      (setq line (string-join (cons line rest) "\n")))
    (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 erc--msg-prop-overrides))
                                  (map-into `((erc--msg . slash-cmd)
                                              ,@(reverse ovs))
                                            'hash-table)))))
        (when-let* ((string (erc-command-indicator))
                    (erc-input-marker (copy-marker erc-input-marker)))
          (erc-display-prompt nil nil string 'erc-command-indicator-face)
          (remove-text-properties insert-position (point)
                                  '(field nil erc-prompt nil))
          (set-marker erc-input-marker nil))
        (let ((beg (point)))
          (insert line)
          (erc-put-text-property beg (point)
                                 'font-lock-face 'erc-command-indicator-face)
          (insert "\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))
          (erc--hide-message 'command-indicator)
          (add-text-properties (point-min) (1+ (point-min))
                               (erc--order-text-properties-from-hash
                                erc--msg-props))))
      (erc--refresh-prompt))))