Function: erc-track--collect-faces-in

erc-track--collect-faces-in is a byte-compiled function defined in erc-track.el.gz.

Signature

(erc-track--collect-faces-in)

Documentation

Collect all faces in the (presumably narrowed) current buffer.

Return a cons cell of a hash table and a list ordered from most recently seen to least.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-track.el.gz
(defun erc-track--collect-faces-in ()
  "Collect all faces in the (presumably narrowed) current buffer.
Return a cons cell of a hash table and a list ordered from most recently
seen to least."
  (let* ((prop (if noninteractive 'font-lock-face 'face))
         (p (text-property-not-all (point-min) (point-max) prop nil))
         (seen (and p (make-hash-table :test #'equal)))
         (faces (make-hash-table :test #'equal))
         (rfaces ()))
    (while p
      (when-let* ((cur (get-text-property p prop)))
        (unless (gethash cur seen)
          (puthash cur t seen)
          (when erc-track--face-reject-function
            (setq cur (funcall erc-track--face-reject-function cur)))
          (when cur
            (push cur rfaces)
            (puthash cur t faces))))
      (setq p (next-single-property-change p prop)))
    (cons faces rfaces)))