From 40ef9f648da48c7d9571182239b1f322efa520c5 Mon Sep 17 00:00:00 2001 From: fallchildren Date: Fri, 9 Feb 2018 14:13:31 +0100 Subject: [PATCH] Fix delayed font-locking issue Due to a previous refactoring of the font-locking a bug was introduced where font-locking was delayed. This happened because c-before-font-lock-functions did not include the function c-change-expand-fl-region. This commit adds it back to the cc-mode variable, so font-locking will not be delayed. c-depropertize-new-text was introduced in current emacs master (will probably be part of emacs 26?) and c-change-expand-fl-region was introduced in emacs 25. These will be checked before calling c-lang-defconst. Github Issue: #414 --- php-mode.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/php-mode.el b/php-mode.el index 6b7074a1..13561cab 100644 --- a/php-mode.el +++ b/php-mode.el @@ -485,9 +485,11 @@ SYMBOL php nil) (c-lang-defconst c-before-font-lock-functions - php (if (fboundp #'c-depropertize-new-text) - '(c-depropertize-new-text) - nil)) + php (let (functions) + (when (fboundp #'c-change-expand-fl-region) + (cl-pushnew 'c-change-expand-fl-region functions)) + (when (fboundp #'c-depropertize-new-text) + (cl-pushnew 'c-depropertize-new-text functions)))) ;; Make php-mode recognize opening tags as preprocessor macro's. ;;