@@ -327,6 +327,7 @@ as a function. Call with AS-NUMBER keyword to compare by `version<'.
327327
328328(defvar php-mode-map
329329 (let ((map (make-sparse-keymap " PHP Mode" )))
330+ (set-keymap-parent map c-mode-base-map)
330331 ; ; Remove menu item for c-mode
331332 (define-key map [menu-bar C] nil )
332333
@@ -1150,14 +1151,14 @@ After setting the stylevars run hook `php-mode-STYLENAME-hook'."
11501151 table))
11511152
11521153;;;### autoload
1153- (define-derived-mode php-mode c -mode " PHP"
1154+ (define-derived-mode php-mode php-base -mode " PHP"
11541155 " Major mode for editing PHP code.
11551156
11561157\\ {php-mode-map}"
11571158 :syntax-table php-mode-syntax-table
1158- ; ; :after-hook (c-update-modeline )
1159- ; ; (setq abbrev-mode t )
1160-
1159+ :after-hook (progn (c-make-noise-macro-regexps )
1160+ ( c-make-macro-with-semi-re )
1161+ ( c-update-modeline ))
11611162 (unless (string= php-mode-cc-version c-version)
11621163 (php-mode-debug-reinstall nil ))
11631164
@@ -1168,8 +1169,16 @@ After setting the stylevars run hook `php-mode-STYLENAME-hook'."
11681169 :warning ))
11691170
11701171 (c-initialize-cc-mode t )
1172+ (setq abbrev-mode t )
1173+
1174+ ; ; Must be called once as c-mode to enable font-lock for Heredoc.
1175+ ; ; TODO: This call may be removed in the future.
1176+ (c-common-init 'c-mode )
1177+
11711178 (c-init-language-vars php-mode)
11721179 (c-common-init 'php-mode )
1180+ (cc-imenu-init cc-imenu-c-generic-expression)
1181+
11731182 (setq-local c-auto-align-backslashes nil )
11741183
11751184 (setq-local comment-start " // " )
@@ -1252,7 +1261,7 @@ After setting the stylevars run hook `php-mode-STYLENAME-hook'."
12521261 (advice-add 'acm-backend-tabnine-candidate-expand
12531262 :filter-args #'php-acm-backend-tabnine-candidate-expand-filter-args )
12541263
1255- (when (>= emacs-major-version 25 )
1264+ (when (eval-when-compile ( >= emacs-major-version 25 ) )
12561265 (with-silent-modifications
12571266 (save-excursion
12581267 (let* ((start (point-min ))
0 commit comments