Remove function wrongly on AWK Mode value of context fontification hook.

* lisp/progmodes/cc-langs.el (c-before-context-fontification-functions):
swap order of entries so that awk's entry isn't superseded by the default.

* lisp/progmodes/cc-mode.el (c-before-context-fl-expand-region): Correct
to handle nil value of c-before-context-fontification-functions.
This commit is contained in:
Alan Mackenzie 2016-01-05 21:16:37 +00:00
parent d400753a0d
commit 73809908c6
2 changed files with 4 additions and 3 deletions

View file

@ -531,8 +531,8 @@ When the mode is initialized, these functions are called with
parameters \(point-min), \(point-max) and <buffer size>.")
(c-lang-defconst c-before-context-fontification-functions
awk nil
t 'c-context-expand-fl-region)
t 'c-context-expand-fl-region
awk nil)
;; For documentation see the following c-lang-defvar of the same name.
;; The value here may be a list of functions or a single function.
(c-lang-defvar c-before-context-fontification-functions

View file

@ -1252,7 +1252,8 @@ Note that the style variables are always made local to the buffer."
(save-restriction
(widen)
(save-excursion
(let ((new-beg beg) (new-end end) new-region)
(let ((new-beg beg) (new-end end)
(new-region (cons beg end)))
(mapc (lambda (fn)
(setq new-region (funcall fn new-beg new-end))
(setq new-beg (car new-region) new-end (cdr new-region)))