Function: font-lock-apply-syntactic-highlight
font-lock-apply-syntactic-highlight is a byte-compiled function
defined in font-lock.el.gz.
Signature
(font-lock-apply-syntactic-highlight HIGHLIGHT)
Documentation
Apply HIGHLIGHT following a match.
HIGHLIGHT should be of the form MATCH-HIGHLIGHT,
see font-lock-syntactic-keywords.
Source Code
;; Defined in /usr/src/emacs/lisp/font-lock.el.gz
;;; Syntactic regexp fontification functions.
;; These syntactic keyword pass functions are identical to those keyword pass
;; functions below, with the following exceptions; (a) they operate on
;; `font-lock-syntactic-keywords' of course, (b) they are all `defun' as speed
;; is less of an issue, (c) eval of property value does not occur JIT as speed
;; is less of an issue, (d) OVERRIDE cannot be `prepend' or `append' as it
;; makes no sense for `syntax-table' property values, (e) they do not do it
;; LOUDLY as it is not likely to be intensive.
(defun font-lock-apply-syntactic-highlight (highlight)
"Apply HIGHLIGHT following a match.
HIGHLIGHT should be of the form MATCH-HIGHLIGHT,
see `font-lock-syntactic-keywords'."
(let* ((match (nth 0 highlight))
(start (match-beginning match)) (end (match-end match))
(value (nth 1 highlight))
(override (nth 2 highlight)))
(if (not start)
;; No match but we might not signal an error.
(or (nth 3 highlight)
(error "No match %d in highlight %S" match highlight))
(when (and (consp value) (not (numberp (car value))))
(setq value (eval value t)))
(when (stringp value) (setq value (string-to-syntax value)))
;; Flush the syntax-cache. I believe this is not necessary for
;; font-lock's use of syntax-ppss, but I'm not 100% sure and it can
;; still be necessary for other users of syntax-ppss anyway.
(syntax-ppss-flush-cache start)
(cond
((not override)
;; Cannot override existing fontification.
(or (text-property-not-all start end 'syntax-table nil)
(put-text-property start end 'syntax-table value)))
((eq override t)
;; Override existing fontification.
(put-text-property start end 'syntax-table value))
((eq override 'keep)
;; Keep existing fontification.
(font-lock-fillin-text-property start end 'syntax-table value))))))