Function: erc-log-matches

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

Signature

(erc-log-matches MATCH-TYPE NICKUSERHOST MESSAGE)

Documentation

Log matches in a separate buffer, determined by MATCH-TYPE.

The behavior of this function is controlled by the variables erc-log-matches-types-alist and erc-log-matches-flag. Specify the match types which should be logged in the former, and deactivate/activate match logging in the latter. See erc-log-match-format.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-match.el.gz
(defun erc-log-matches (match-type nickuserhost message)
  "Log matches in a separate buffer, determined by MATCH-TYPE.
The behavior of this function is controlled by the variables
`erc-log-matches-types-alist' and `erc-log-matches-flag'.
Specify the match types which should be logged in the former,
and deactivate/activate match logging in the latter.
See `erc-log-match-format'."
  (let  ((match-buffer-name (cdr (assq match-type
				       erc-log-matches-types-alist)))
	 (nick (nth 0 (erc-parse-user nickuserhost))))
    (when (and
	   (or (eq erc-log-matches-flag t)
	       (and (eq erc-log-matches-flag 'away)
		    (erc-away-time)))
	   match-buffer-name)
      (let ((line (format-spec
                   erc-log-match-format
                   `((?n . ,nick)
                     (?t . ,(format-time-string
                             (or (bound-and-true-p erc-timestamp-format)
                                 "[%Y-%m-%d %H:%M] ")))
                     (?c . ,(or (erc-default-target) ""))
                     (?m . ,message)
                     (?u . ,nickuserhost)))))
	(with-current-buffer (erc-log-matches-make-buffer match-buffer-name)
	  (let ((inhibit-read-only t))
	    (goto-char (point-max))
	    (insert line)))))))