Function: erc--insert-before-markers-transplanting-hidden

erc--insert-before-markers-transplanting-hidden is a byte-compiled function defined in erc.el.gz.

Signature

(erc--insert-before-markers-transplanting-hidden STRING)

Documentation

Insert STRING before markers and migrate any invisible props.

Expect to be called with point at the start of an inserted message, i.e., one with an erc--msg property. Check the message prop header for invisibility props advertised via erc--hide. When found, remove them from the previous newline, and add them to the newline suffixing the inserted version of STRING.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--insert-before-markers-transplanting-hidden (string)
  "Insert STRING before markers and migrate any `invisible' props.
Expect to be called with `point' at the start of an inserted message,
i.e., one with an `erc--msg' property.  Check the message prop header
for invisibility props advertised via `erc--hide'.  When found, remove
them from the previous newline, and add them to the newline suffixing
the inserted version of STRING."
  (let* ((after (and (not erc-legacy-invisible-bounds-p)
                     (get-text-property (point) 'erc--hide)))
         (before (and after (> (point) (point-min))
                      (get-text-property (1- (point)) 'invisible)))
         (a (and after (ensure-list after)))
         (b (and before (ensure-list before)))
         (new (and before (erc--solo (cl-intersection b a)))))
    (when new
      (erc--remove-from-prop-value-list (1- (point)) (point) 'invisible a))
    (prog1 (insert-before-markers string)
      (when new
        (erc--merge-prop (1- (point)) (point) 'invisible new)))))