:type 'float
:group 'context-coloring)
-(make-obsolete-variable
- 'context-coloring-delay
- 'context-coloring-default-delay
- "6.4.0")
-
(defun context-coloring-cancel-timer (timer)
"Cancel TIMER."
(when timer
end
`(face ,(context-coloring-bounded-level-face level))))
-(make-obsolete-variable
- 'context-coloring-comments-and-strings
- "use `context-coloring-syntactic-comments' and
- `context-coloring-syntactic-strings' instead."
- "6.1.0")
-
(defcustom context-coloring-syntactic-comments t
"If non-nil, also color comments using `font-lock'."
:type 'boolean
"Color a string according to STATE."
(if (nth 3 state) font-lock-string-face nil))
-(defsubst context-coloring-colorize-comments-and-strings (&optional min max)
+(defsubst context-coloring-colorize-comments-and-strings (&optional min max keywords-p)
"Maybe color comments and strings in buffer from MIN to MAX.
-MIN defaults to beginning of buffer. MAX defaults to end."
+MIN defaults to beginning of buffer. MAX defaults to end. If
+KEYWORDS-P is non-nil, also color keywords from MIN to MAX."
(when (or context-coloring-syntactic-comments
context-coloring-syntactic-strings)
(let ((min (or min (point-min)))
font-lock-syntactic-face-function))))
(save-excursion
(font-lock-fontify-syntactically-region min max)
- ;; TODO: Make configurable at the dispatch level.
- (when (eq major-mode 'emacs-lisp-mode)
+ (when keywords-p
(font-lock-fontify-keywords-region min max))))))
(defcustom context-coloring-initial-level 0