* lisp/font-lock.el (font-lock-set-defaults): Make
`font-lock-add-keywords' work in derived modes (bug#24176).
Sets various variables using `font-lock-defaults' and
`font-lock-maximum-decoration'."
;; Set fontification defaults if not previously set for correct major mode.
- (unless (and font-lock-set-defaults
- (eq font-lock-major-mode major-mode))
+ (when (or (not font-lock-set-defaults)
+ (not font-lock-major-mode)
+ (not (derived-mode-p font-lock-major-mode)))
(setq font-lock-major-mode major-mode)
(setq font-lock-set-defaults t)
(let* ((defaults font-lock-defaults)