Function: erc--restore-important-text-props

erc--restore-important-text-props is a byte-compiled function defined in erc.el.gz.

Signature

(erc--restore-important-text-props PROPS &optional BEG END)

Documentation

Restore PROPS where recorded in the accessible portion of the buffer.

Expect to run in a narrowed buffer at message-insertion time. Limit the effect to the region between buffer positions BEG and END, when non-nil.

Callers should be aware that this function fails if the property erc--important-props has an empty value almost anywhere along the affected region. Use the function erc--remove-from-prop-value-list to ensure that props with empty values are excised completely.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--restore-important-text-props (props &optional beg end)
  "Restore PROPS where recorded in the accessible portion of the buffer.
Expect to run in a narrowed buffer at message-insertion time.  Limit the
effect to the region between buffer positions BEG and END, when non-nil.

Callers should be aware that this function fails if the property
`erc--important-props' has an empty value almost anywhere along the
affected region.  Use the function `erc--remove-from-prop-value-list' to
ensure that props with empty values are excised completely."
  (when-let* ((registered (erc--check-msg-prop 'erc--important-prop-names))
              (present (seq-intersection props registered))
              (b (or beg (point-min)))
              (e (or end (point-max))))
    (while-let
        (((setq b (text-property-not-all b e 'erc--important-props nil)))
         (val (get-text-property b 'erc--important-props))
         (q (next-single-property-change b 'erc--important-props nil e)))
      (while-let ((k (pop val))
                  (v (pop val)))
        (when (memq k present)
          (put-text-property b q k v)))
      (setq b q))))