Function: rcirc-markup-keywords

rcirc-markup-keywords is a byte-compiled function defined in rcirc.el.gz.

Signature

(rcirc-markup-keywords SENDER RESPONSE)

Documentation

Highlight keywords as specified by rcirc-keywords.

Keywords are only highlighted in messages (as indicated by RESPONSE) when they were not written by the user (as indicated by SENDER).

Source Code

;; Defined in /usr/src/emacs/lisp/net/rcirc.el.gz
(defun rcirc-markup-keywords (sender response)
  "Highlight keywords as specified by `rcirc-keywords'.
Keywords are only highlighted in messages (as indicated by
RESPONSE) when they were not written by the user (as indicated by
SENDER)."
  (when (and (string= response "PRIVMSG")
	     (not (string= sender (rcirc-nick (rcirc-buffer-process)))))
    (let* ((target (or rcirc-target ""))
	   (keywords (delq nil (mapcar (lambda (keyword)
					 (when (not (string-match keyword
								  target))
					   keyword))
				       rcirc-keywords))))
      (when keywords
	(while (re-search-forward (regexp-opt keywords 'words) nil t)
	  (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword)
	  (rcirc-record-activity (current-buffer) 'keyword))))))