Function: erc-match--message

erc-match--message is a byte-compiled function defined in erc-match.el.gz.

Signature

(erc-match--message)

Documentation

Run erc-match-functions against contents of narrowed buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-match.el.gz
(defun erc-match--message ()
  "Run `erc-match-functions' against contents of narrowed buffer."
  (goto-char (point-min))
  (let* ((response erc--parsed-response)
         (user-nuh (and response (erc-get-parsed-vector-nick response)))
         ;; Nick of sender's NUH if they are not the server itself.
         (nick (and user-nuh (or (erc--check-msg-prop 'erc--spkr)
                                 (erc-extract-nick user-nuh))))
         (unknownp (erc--check-msg-prop 'erc--msg 'unknown))
         (spkr-end (and (not unknownp) (erc--get-speaker-bounds)))
         (spkr-beg (and spkr-end (pop spkr-end)))
         (body-beg (save-excursion
                     (unless unknownp
                       (when-let* ((fn (erc--check-msg-prop 'erc--pfx)))
                         (funcall fn)))
                     (point-marker)))
         (command (erc--check-msg-prop 'erc--cmd))
         (erc-match--instances ()))
    (with-syntax-table erc-match-syntax-table
      (run-hook-wrapped 'erc-match-functions #'erc-match--run-match
                        spkr-beg spkr-end body-beg nick
                        (erc-response.sender response) command))))