Make `font-lock-add-keywords' work in derived modes
* lisp/font-lock.el (font-lock-set-defaults): Make `font-lock-add-keywords' work in derived modes (bug#24176).
This commit is contained in:
parent
806a121007
commit
77b72f77b3
1 changed files with 3 additions and 2 deletions
|
@ -1906,8 +1906,9 @@ preserve `hi-lock-mode' highlighting patterns."
|
|||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue