diff --git a/lisp/php-mode.el b/lisp/php-mode.el index afd51294..bae38fc0 100644 --- a/lisp/php-mode.el +++ b/lisp/php-mode.el @@ -102,7 +102,7 @@ (let ((tag (replace-regexp-in-string (rx bos "v") "" (shell-command-to-string "git describe --tags"))) - (pattern (rx (group (+ any)) eol))) + (pattern (rx (group (+ nonl)) eol))) (if (string-match pattern tag) (match-string 0 tag) (error "Faild to obtain git tag")))) @@ -470,6 +470,12 @@ any) is a brace list. PHP does not have an C-like \"enum\" keyword." php nil) +;; cc-mode renamed `c-after-brace-list-decl-kwds' to `c-after-enum-list-kwds'; +;; keep the old name defined so cc-langs' transitional lookup stays quiet where +;; the rename landed (see `c-after-enum-list-key' in cc-langs.el). +(c-lang-defconst c-after-brace-list-decl-kwds + php nil) + (c-lang-defconst c-typeless-decl-kwds php (append (c-lang-const c-class-decl-kwds php) '("function" "const"))) @@ -1179,13 +1185,19 @@ After setting the stylevars run hook `php-mode-STYLENAME-hook'." (setq-local comment-end "") (setq-local page-delimiter php-mode-page-delimiter) - (setq-local font-lock-string-face 'php-string) - (setq-local font-lock-keyword-face 'php-keyword) - (setq-local font-lock-builtin-face 'php-builtin) - (setq-local c-preprocessor-face-name 'php-php-tag) - (setq-local font-lock-function-name-face 'php-function-name) - (setq-local font-lock-variable-name-face 'php-variable-name) - (setq-local font-lock-constant-face 'php-constant) + (with-suppressed-warnings ((obsolete font-lock-string-face + font-lock-keyword-face + font-lock-builtin-face + font-lock-function-name-face + font-lock-variable-name-face + font-lock-constant-face)) + (setq-local font-lock-string-face 'php-string) + (setq-local font-lock-keyword-face 'php-keyword) + (setq-local font-lock-builtin-face 'php-builtin) + (setq-local c-preprocessor-face-name 'php-php-tag) + (setq-local font-lock-function-name-face 'php-function-name) + (setq-local font-lock-variable-name-face 'php-variable-name) + (setq-local font-lock-constant-face 'php-constant)) (setq-local syntax-propertize-function #'php-syntax-propertize-function) (add-hook 'syntax-propertize-extend-region-functions diff --git a/lisp/php.el b/lisp/php.el index ef46272c..3124ced0 100644 --- a/lisp/php.el +++ b/lisp/php.el @@ -327,7 +327,7 @@ which will be the name of the method." (* (syntax whitespace)) "(" ,@(when include-args - '((* any) line-end)))))) + '((* nonl) line-end)))))) (defun php-create-regexp-for-classlike (type) "Accepts a `TYPE' of a `classlike' object as a string, such as @@ -378,7 +378,7 @@ can be used to match against definitions for that classlike." (+ (or (syntax word) (syntax symbol))) (* (syntax whitespace)) (? "=" (* (syntax whitespace)) - (repeat 0 40 any)))) + (repeat 0 40 nonl)))) 1) ("Functions" ,(rx line-start @@ -389,7 +389,7 @@ can be used to match against definitions for that classlike." (+ (or (syntax word) (syntax symbol))) (* (syntax whitespace)) "(" - (repeat 0 100 any))) + (repeat 0 100 nonl))) 1) ("Import" ,(rx line-start @@ -397,7 +397,7 @@ can be used to match against definitions for that classlike." (group "use" (+ (syntax whitespace)) - (repeat 0 100 any))) + (repeat 0 100 nonl))) 1) ("Classes" ,(php-create-regexp-for-classlike "\\(?:class\\|interface\\|trait\\|enum\\)") 0)