Function: erc-match--run-match

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

Signature

(erc-match--run-match CONSTRUCTOR SPKR-BEG SPKR-END BODY-BEG NICK SENDER COMMAND)

Documentation

Run erc-match handler if its predicate returns non-nil.

Call CONSTRUCTOR with SPKR-BEG, SPKR-END, BODY-BEG, NICK SENDER, and COMMAND to create the erc-match instance.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-match.el.gz
(defun erc-match--run-match (constructor spkr-beg spkr-end body-beg
                                         nick sender command)
  "Run `erc-match' handler if its predicate returns non-nil.
Call CONSTRUCTOR with SPKR-BEG, SPKR-END, BODY-BEG, NICK SENDER, and
COMMAND to create the `erc-match' instance."
  (when-let* ((instance (funcall constructor
                                 :spkr-beg spkr-beg
                                 :spkr-end spkr-end
                                 :body-beg body-beg
                                 :nick nick
                                 :sender sender
                                 :command command))
              (_ (or nick (not (erc-match-user-p instance))))
              (_ (goto-char (point-min)))
              (_ (funcall (erc-match-predicate instance) instance)))
    (if (erc-match-newlinep instance)
        (funcall (erc-match-handler instance) instance)
      (with-restriction (point-min) (1- (point-max))
        (funcall (erc-match-handler instance) instance)))
    (push (cons constructor instance) erc-match--instances)
    nil))