Skip to content

Commit ef9e9fa

Browse files
committed
Check CC Mode version when startup php-mode
If the user leaves this warning unattended, PHP Mode will cause an error and prompt the user for proper operation. I expect this diff to occur immediately after updating Emacs.
1 parent 6ecb717 commit ef9e9fa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

php-mode.el

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ In that case set to `NIL'."
318318
:tag "PHP Mode Enable Project Local Variable"
319319
:type 'boolean)
320320

321+
(defconst php-mode-cc-vertion
322+
(eval-when-compile c-version))
323+
321324
(defun php-mode-version ()
322325
"Display string describing the version of PHP Mode."
323326
(interactive)
@@ -1131,6 +1134,13 @@ After setting the stylevars run hooks according to STYLENAME
11311134
:syntax-table php-mode-syntax-table
11321135
;; :after-hook (c-update-modeline)
11331136
;; (setq abbrev-mode t)
1137+
1138+
(unless (string= php-mode-cc-vertion c-version)
1139+
(user-error "CC Mode has been updated. %s"
1140+
(if (package-installed-p 'php-mode)
1141+
"Please run `M-x package-reinstall php-mode' command."
1142+
"Please byte recompile PHP Mode files.")))
1143+
11341144
(when php-mode-disable-c-mode-hook
11351145
(setq-local c-mode-hook nil)
11361146
(setq-local java-mode-hook nil))

0 commit comments

Comments
 (0)