From 472c44f9d63e57f167897b5abf5a29e9c2341380 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Fri, 3 Jul 2026 02:29:33 +0900 Subject: [PATCH 1/3] Use nonl instead of any in RX form --- lisp/php-mode.el | 2 +- lisp/php.el | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/php-mode.el b/lisp/php-mode.el index afd51294..d6537ab9 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")))) 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) From 1c9e08dde1eb83286547ec5d832689533bf91cad Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Fri, 3 Jul 2026 02:29:53 +0900 Subject: [PATCH 2/3] Set c-after-brace-list-decl-kwds --- lisp/php-mode.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/php-mode.el b/lisp/php-mode.el index d6537ab9..38534b13 100644 --- a/lisp/php-mode.el +++ b/lisp/php-mode.el @@ -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"))) From dc13865a3b911f87676ff823ad7968a3d786cbc0 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Fri, 3 Jul 2026 02:30:26 +0900 Subject: [PATCH 3/3] Add guard to obsolete font-lock-* variables --- lisp/php-mode.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lisp/php-mode.el b/lisp/php-mode.el index 38534b13..bae38fc0 100644 --- a/lisp/php-mode.el +++ b/lisp/php-mode.el @@ -1185,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