From e31073a5030932da37a72df9b8a5be017189d450 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Tue, 25 Aug 2026 21:54:36 +0900 Subject: [PATCH] Bump up version 1.28.0 --- .github/workflows/test.yml | 5 +- CHANGELOG.md | 106 ++++++++++++++++--------------------- Eask | 4 +- README.ja.md | 6 +-- README.md | 8 +-- lisp/php-align.el | 2 +- lisp/php-complete.el | 2 +- lisp/php-defs.el | 2 +- lisp/php-face.el | 2 +- lisp/php-flymake.el | 2 +- lisp/php-ide-phpactor.el | 2 +- lisp/php-ide.el | 2 +- lisp/php-mode-debug.el | 2 +- lisp/php-mode.el | 6 +-- lisp/php-project.el | 2 +- lisp/php.el | 2 +- 16 files changed, 68 insertions(+), 87 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f775ca36..1ed63814 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,10 +20,10 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] emacs-version: - - "27.2" - "28.2" - "29.4" - "30.2" + # - "31.1" experimental: [false] include: - os: ubuntu-latest @@ -35,9 +35,6 @@ jobs: - os: windows-latest emacs-version: snapshot experimental: true - exclude: - - os: macos-latest - emacs-version: "27.2" steps: - uses: actions/setup-python@v7 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index b3a848d2..123719a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,87 +1,71 @@ # Changes for PHP Mode by Version -All notable changes of the PHP Mode 1.19.1 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +This file documents notable changes to PHP Mode according to the [Keep a Changelog](https://keepachangelog.com/) principles. -## Unreleased + + +## [1.28.0] - 2026-08-25 ### Added - * `php-project-get-root-dir` falls back to `project-current` when no PHP-specific marker is found, so `project.el` backends (Projectile 3, `project-vc-extra-root-markers`, etc.) can contribute project detection - * Add `php-ide-set-feature` command to interactively enable a PHP-IDE feature for the current buffer - * Only offers features whose backing package is actually available - * Add `php-ide-status` command to report the current PHP-IDE state for the current buffer - * Shows whether it is on, what is configured, and what is available - * Add `php-ide-eglot-activate`, which registers `php-ide-eglot-executable` into `eglot-server-programs` - * Buffer-local, so only buffers that set the variable are affected; previously the variable had no effect on Eglot at all - * Add a `phpantom` preset to `php-ide-lsp-command-alist` for the [PHPantom](https://github.com/PHPantom-dev/phpantom_lsp) PHP language server - * Set `php-ide-eglot-executable` to `'phpantom` (safe for `.dir-locals.el`) to run `phpantom_lsp` under Eglot - * Add a `php-lsp` preset to `php-ide-lsp-command-alist` for the [php-lsp](https://github.com/jorgsowa/php-lsp) PHP language server - * Set `php-ide-eglot-executable` to `'php-lsp` (safe for `.dir-locals.el`) to run `php-lsp` under Eglot - * Add `php-cc-mode` as a forward-compatible alias for the CC Mode based `php-mode` - * Lets configuration and third-party code refer to the CC Mode implementation by the name it will keep once `php-mode` becomes cc-mode independent; loading it has no effect on `php-mode` itself - * `php-cc-mode-hook`, `php-cc-mode-lineup-cascaded-calls` and `php-cc-mode-enable-backup-style-variables` are provided as aliases of their current `php-mode-*` counterparts + * Add `php-phpdbg-disassemble-file` and `php-parse-file` commands ([#804]) + * Select an HTML template major mode for PHP files that contain HTML and add per-project control through `php-project-php-file-as-template` ([#742]) + * Include `php-align.el` and `php-flymake.el` in the package ([#820]) + * Add a `php-pipe-op` face for PHP 8.5's pipe operator ([#821]) + * Add `php-ide-set-feature`, `php-ide-status`, and `php-ide-eglot-activate` commands ([#826]) + * Add `phpantom` and `php-lsp` presets to `php-ide-lsp-command-alist` ([#830]) + * Add `php-cc-mode` as a forward-compatible alias for the CC Mode based `php-mode` ([#828]) ### Changed * Add `readonly` class modifier to [Imenu] ([#802]) * Add `enum` support to `php-current-class` ([#802]) * Remove hardcoding of implicit paths in `php` that are not guaranteed to exist ([#803]) - * `php-ide-turn-on` no longer errors when `php-ide-features` is unset - * It is now a silent no-op, matching the README's `hack-local-variables-hook` recipe, which previously errored on every PHP file until a feature was configured - * `php-ide-features` now also accepts a bare feature symbol, not just a list - * This was already shown (but not actually supported) in `php-ide.el`'s own Commentary - * Restrict `:safe` on `php-ide-features`/`php-ide-eglot-executable`, and drop `:safe` from `php-ide-mode-functions` entirely - * Previously these let a `.dir-locals.el` silently run an attacker-chosen command or Lisp function without Emacs's usual confirmation; now only PHP-IDE's own known feature symbols and bundled executable presets are accepted - * **If you now get prompted** by a `.dir-locals.el` you wrote and trust yourself (e.g. `php-ide-eglot-executable` set to a raw path/command, or any use of `php-ide-mode-functions`), this is expected — PHP-IDE can no longer vouch for that value as safe. Answer `!` at the prompt to permanently remember that exact value (all supported Emacs versions), or `+` to trust the whole directory from then on (Emacs 30.1+); see `(info "(emacs) Directory Variables")`. You can also pre-approve values ahead of time in your own init file via `safe-local-variable-values` / `safe-local-variable-directories`, so you are never prompted even on first visit. - * `php-ide-mode-functions` was always meant to be configured globally with `add-hook` in your init file (see the Commentary in `php-ide.el`), not set per-project via `.dir-locals.el`. For per-project behavior, branch on the `FEATURE` argument inside your hook function instead of varying the variable's value by directory. - * Mark `php-ide-feature-alist` and `php-ide-lsp-command-alist` as risky local variables - * They decide which command PHP-IDE executes and which functions it calls, and adding an entry to `php-ide-lsp-command-alist` also makes that entry pass the `:safe` check of `php-ide-eglot-executable` — so a project could otherwise have supplied both the command and its own approval. Risky variables are always confirmed and never remembered as safe - * `php-ide-mode` now warns when `php-ide-features` enables more than one LSP client at once - * Activation still proceeds; Phpactor's bridge is not an LSP client and pairs with one without a warning - * Make `php-ide-lsp-command-alist` and `php-ide-eglot-managed-modes` customizable - * Adding your own preset to `php-ide-lsp-command-alist` is also how you let a project select that server from `.dir-locals.el` without confirming an executable path - * Narrow the "experimental" note in `php-ide.el` to what it actually covers - * The options and commands documented in the README are settled; what may still change is how a feature is described to PHP-IDE (the `php-ide-feature-alist` entry keywords and `php-ide--...` internals) + * Make `php-mode-maybe` honor `major-mode-remap-alist` ([#816]) + * Let `php-project-get-root-dir` use `project.el` backends after PHP-specific markers ([#823]) + * Make `php-ide-features` accept a bare feature symbol and make `php-ide-turn-on` a no-op when no features are configured ([#826]) + * Restrict safe directory-local PHP-IDE values and mark command and function alists as risky ([#826]) + * Warn about multiple active LSP clients and make PHP-IDE server and mode alists customizable ([#827]) ### Fixed - * `php-project-project-find-function` now returns a `project.el` value valid on Emacs 28+; it previously built a `(vc . ROOT)` cons that broke the 3-element `(vc BACKEND ROOT)` representation and made `project-root` signal an error - * Fix the `:safe` predicate of `php-complete-function-modules`, which accepted any list and never actually applied - * It looped over the standard Emacs variable `values` instead of its own argument, so `cl-loop ... always` succeeded vacuously and unknown module names passed as safe - * Emacs also checks directory-local values *before* php-complete.el is loaded, so the predicate ran as copied into the autoloads file and hit `void-function cl-loop`. `safe-local-variable-p` demotes such errors to nil, so every project setting this variable was prompted for confirmation regardless - * That half of the fix applies on Emacs 28 and later; Emacs 27 does not copy `:safe` predicates into the autoloads file at all, so it keeps prompting until php-complete.el is loaded - * Fix function name completion sorting the user's `php-complete-function-modules` in place - * The first completion reordered the value the user had set, e.g. `(pcntl bcmath core)` became `(bcmath core pcntl)` - * Fix function name completion offering module names as if they were PHP functions - * Entries of `php-defs-functions-alist` are `(MODULE . FUNCTION-NAMES)` and the whole entry was appended, so every enabled module leaked its own name into the candidates - * Fix the `phpactor` PHP-IDE feature's `:deactivate` to actually deactivate - * It pointed at `php-ide-phpactor-activate` instead of `php-ide-phpactor-deactivate`, so turning `php-ide-mode` off re-activated Phpactor instead - * Fix `php-ide-eglot-server-program` to return a valid command list for symbolic `php-ide-eglot-executable` values - * e.g. `intelephense`, `phpactor` — the `assq` result was used without `cdr` - * Fix the `lsp-mode` PHP-IDE feature's `:deactivate` to no longer error when turning `php-ide-mode` off - * It called `lsp-workspace-shutdown`, which requires a `WORKSPACE` argument and signalled `wrong-number-of-arguments`; switched to the buffer-scoped `lsp-disconnect` - * Fix the `:safe` predicates of `php-ide-features`/`php-ide-eglot-executable`, which never actually applied - * Emacs checks directory-local values *before* `php-ide.el` is loaded, so the predicates ran as copied into the autoloads file, where they hit `void-function cl-loop` / `void-variable php-ide-lsp-command-alist`. `safe-local-variable-p` demotes such errors to nil, so every project setting these variables was prompted for confirmation regardless - * Fix Phpactor hover suppression to match its documented "any predicate matches" behavior - * `php-ide-phpactor-disable-hover-at-point-functions` was combined with AND, so an empty list disabled hover everywhere and multiple predicates only fired when all matched - * Fix `php-ide-mode` deactivation stopping Phpactor hover in unrelated buffers - * The hover timer is shared by all buffers but was cancelled unconditionally; it is now retired only once no live buffer uses hover - * Fix `php-ide-mode` staying on after a feature failed to activate - * The mode line claimed PHP-IDE was running while nothing had started, and turning it back off then signalled `void-function`. Activation now rolls back and leaves the mode off - * Fix `php-ide-mode` deactivating the wrong feature after `php-ide-features` changes - * Deactivation re-read the variable, so editing `.dir-locals.el` and re-applying it to a live buffer stranded the feature that was really running; it now tracks what it activated - * Fix `php-ide-mode` activating features twice when it is re-enabled - * `hack-local-variables-hook`, where the documented recipe puts `php-ide-turn-on`, runs again on `revert-buffer` and friends - * Fix the `phpactor` PHP-IDE feature failing to activate outside a package installation - * `php-ide.el` requires `php-ide-phpactor` only at compile time, so its `:activate`/`:deactivate` resolved only via the package autoloads; the feature now loads it from `:test` + * Fix array alignment when an empty line is present ([#801]) + * Fix compatibility with upcoming Emacs 32 ([#809]) + * Fix PHP function completion sorting, module filtering, and directory-local validation ([#825]) + * Fix PHP-IDE feature activation, deactivation, repeated enabling, and Phpactor hover cleanup ([#826], [#827]) + * Return a valid `project.el` representation from `php-project-project-find-function` ([#823]) + * Fall back to an HTML mode for Blade templates when `web-mode` is unavailable ([#817]) + * Use one PHP executable source for project and Flymake integrations ([#818]) + * Fix compilation of `php-flymake` with current Emacs versions ([#829]) ### Deprecated * `php-project-use-projectile-to-detect-root` is obsolete; Projectile 3 registers itself on `project-find-functions`, which `php-project-get-root-dir` now consults automatically +### Removed + + * Drop support for Emacs 27.x ([#811]) + [Imenu]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html +[#742]: https://github.com/emacs-php/php-mode/pull/742 +[#801]: https://github.com/emacs-php/php-mode/pull/801 [#802]: https://github.com/emacs-php/php-mode/pull/802 [#803]: https://github.com/emacs-php/php-mode/pull/803 +[#804]: https://github.com/emacs-php/php-mode/pull/804 +[#809]: https://github.com/emacs-php/php-mode/pull/809 +[#811]: https://github.com/emacs-php/php-mode/issues/811 +[#816]: https://github.com/emacs-php/php-mode/pull/816 +[#817]: https://github.com/emacs-php/php-mode/pull/817 +[#818]: https://github.com/emacs-php/php-mode/pull/818 +[#820]: https://github.com/emacs-php/php-mode/pull/820 +[#821]: https://github.com/emacs-php/php-mode/pull/821 +[#823]: https://github.com/emacs-php/php-mode/pull/823 +[#825]: https://github.com/emacs-php/php-mode/pull/825 +[#826]: https://github.com/emacs-php/php-mode/pull/826 +[#827]: https://github.com/emacs-php/php-mode/pull/827 +[#828]: https://github.com/emacs-php/php-mode/pull/828 +[#829]: https://github.com/emacs-php/php-mode/pull/829 +[#830]: https://github.com/emacs-php/php-mode/pull/830 ## [1.27.0] - 2024-12-20 diff --git a/Eask b/Eask index 70a2566f..edfca1c3 100644 --- a/Eask +++ b/Eask @@ -1,7 +1,7 @@ ;; -*- mode: eask; lexical-binding: t -*- (package "php-mode" - "1.26.1" + "1.28.0" "Major mode for editing PHP code") (website-url "https://github.com/emacs-php/php-mode") @@ -32,7 +32,7 @@ (source 'melpa) (source 'gnu) -(depends-on "emacs" "27.1") +(depends-on "emacs" "28.1") (development (depends-on "phpactor") diff --git a/README.ja.md b/README.ja.md index d09a65e8..9964562a 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,8 +1,8 @@

Emacs PHP Mode

-[![Emacs: 30.0](https://img.shields.io/badge/Emacs-30.0-blue.svg)](https://www.gnu.org/software/emacs/) -[![lang: PHP 8.4](https://img.shields.io/badge/lang-PHP%208.4-brightgreen.svg)](https://www.php.net/releases/8.4/) +[![Emacs: 31.1](https://img.shields.io/badge/Emacs-31.1-blue.svg)](https://www.gnu.org/software/emacs/) +[![lang: PHP 8.5](https://img.shields.io/badge/lang-PHP%208.5-brightgreen.svg)](https://www.php.net/releases/8.5/) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) [![GPL v3](https://img.shields.io/badge/license-GPL_v3-green.svg)][gpl-v3]
[![NonGNU ELPA][nongnu-elpa-badge]][nongnu-elpa] @@ -29,7 +29,7 @@ A powerful and flexible Emacs major mode for editing PHP scripts ## インストール -**PHP ModeはEmacs 27.1以降で動作します**。対応バージョンの詳細は[Supported Version]をお読みください。Emacs 28以降では単に以下のコマンドを実行するだけでインストールできます。 +**PHP ModeはEmacs 28.1以降で動作します**。対応バージョンの詳細は[Supported Version]をお読みください。Emacs 28.1以降では単に以下のコマンドを実行するだけでインストールできます。 ``` M-x package-install php-mode diff --git a/README.md b/README.md index 9ed9ad8e..98afa85f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

Emacs PHP Mode

-[![Emacs: 30.0](https://img.shields.io/badge/Emacs-30.0-blue.svg)](https://www.gnu.org/software/emacs/) -[![lang: PHP 8.4](https://img.shields.io/badge/lang-PHP%208.4-brightgreen.svg)](https://www.php.net/releases/8.4/) +[![Emacs: 31.1](https://img.shields.io/badge/Emacs-31.1-blue.svg)](https://www.gnu.org/software/emacs/) +[![lang: PHP 8.5](https://img.shields.io/badge/lang-PHP%208.5-brightgreen.svg)](https://www.php.net/releases/8.5/) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) [![GPL v3](https://img.shields.io/badge/license-GPL_v3-green.svg)][gpl-v3]
[![NonGNU ELPA][nongnu-elpa-badge]][nongnu-elpa] @@ -30,8 +30,8 @@ Please submit any bug reports or feature requests by creating issues on [the Git ## Installation -**PHP Mode works with Emacs 27.1 or later.** For details on supported versions, see [Supported Version]. -On Emacs 28 or later, you can install it simply by running: +**PHP Mode works with Emacs 28.1 or later.** For details on supported versions, see [Supported Version]. +On Emacs 28.1 or later, you can install it simply by running: ``` M-x package-install php-mode diff --git a/lisp/php-align.el b/lisp/php-align.el index e9acc469..aa39ff7f 100644 --- a/lisp/php-align.el +++ b/lisp/php-align.el @@ -7,7 +7,7 @@ ;; Maintainer: USAMI Kenta ;; Keywords: php languages convenience align ;; Homepage: https://github.com/emacs-php/php-mode -;; Version: 1.26.1 +;; Version: 1.28.0 ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-complete.el b/lisp/php-complete.el index 394e3efb..1af75b62 100644 --- a/lisp/php-complete.el +++ b/lisp/php-complete.el @@ -6,7 +6,7 @@ ;; Author: USAMI Kenta ;; Created: 18 Sep 2022 -;; Version: 1.26.1 +;; Version: 1.28.0 ;; Keywords: languages, php ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-defs.el b/lisp/php-defs.el index d528e4de..6b6455c2 100644 --- a/lisp/php-defs.el +++ b/lisp/php-defs.el @@ -4,7 +4,7 @@ ;; Author: USAMI Kenta ;; Created: 5 Mar 2022 -;; Version: 1.26.1 +;; Version: 1.28.0 ;; Keywords: languages, php ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-face.el b/lisp/php-face.el index 85aa38dd..b9b99d44 100644 --- a/lisp/php-face.el +++ b/lisp/php-face.el @@ -4,7 +4,7 @@ ;; Author: USAMI Kenta ;; Created: 5 May 2019 -;; Version: 1.26.1 +;; Version: 1.28.0 ;; Keywords: faces, php ;; Homepage: https://github.com/emacs-php/php-mode ;; License: GPL-3.0-or-later diff --git a/lisp/php-flymake.el b/lisp/php-flymake.el index 1477faf6..6aa01df8 100644 --- a/lisp/php-flymake.el +++ b/lisp/php-flymake.el @@ -4,7 +4,7 @@ ;; Author: USAMI Kenta ;; Created: 5 Mar 2022 -;; Version: 1.26.1 +;; Version: 1.28.0 ;; Keywords: tools, languages, php ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-ide-phpactor.el b/lisp/php-ide-phpactor.el index a99a3784..42b9be31 100644 --- a/lisp/php-ide-phpactor.el +++ b/lisp/php-ide-phpactor.el @@ -5,7 +5,7 @@ ;; Author: USAMI Kenta ;; Keywords: tools, files ;; URL: https://github.com/emacs-php/php-mode -;; Version: 1.26.1 +;; Version: 1.28.0 ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-ide.el b/lisp/php-ide.el index 78fed583..f837621b 100644 --- a/lisp/php-ide.el +++ b/lisp/php-ide.el @@ -5,7 +5,7 @@ ;; Author: USAMI Kenta ;; Keywords: tools, files ;; URL: https://github.com/emacs-php/php-mode -;; Version: 1.26.1 +;; Version: 1.28.0 ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-mode-debug.el b/lisp/php-mode-debug.el index efe6e48e..d0c0d3a8 100644 --- a/lisp/php-mode-debug.el +++ b/lisp/php-mode-debug.el @@ -5,7 +5,7 @@ ;; Author: USAMI Kenta ;; URL: https://github.com/emacs-php/php-mode ;; Keywords: maint -;; Version: 1.26.1 +;; Version: 1.28.0 ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-mode.el b/lisp/php-mode.el index 37d4297d..12b46e07 100644 --- a/lisp/php-mode.el +++ b/lisp/php-mode.el @@ -9,13 +9,13 @@ ;; Maintainer: USAMI Kenta ;; URL: https://github.com/emacs-php/php-mode ;; Keywords: languages php -;; Version: 1.26.1 -;; Package-Requires: ((emacs "27.1")) +;; Version: 1.28.0 +;; Package-Requires: ((emacs "28.1")) ;; License: GPL-3.0-or-later (eval-and-compile (make-obsolete-variable - (defconst php-mode-version-number "1.26.1" "PHP Mode version number.") + (defconst php-mode-version-number "1.28.0" "PHP Mode version number.") "Please call (php-mode-version :as-number t) for compatibility." "1.24.2")) ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php-project.el b/lisp/php-project.el index 57e5ae33..461c1e24 100644 --- a/lisp/php-project.el +++ b/lisp/php-project.el @@ -5,7 +5,7 @@ ;; Author: USAMI Kenta ;; Keywords: tools, files ;; URL: https://github.com/emacs-php/php-mode -;; Version: 1.26.1 +;; Version: 1.28.0 ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/php.el b/lisp/php.el index 1a0bb8a0..50d8ae9f 100644 --- a/lisp/php.el +++ b/lisp/php.el @@ -5,7 +5,7 @@ ;; Author: USAMI Kenta ;; Created: 5 Dec 2018 -;; Version: 1.26.1 +;; Version: 1.28.0 ;; Keywords: languages, php ;; Homepage: https://github.com/emacs-php/php-mode ;; License: GPL-3.0-or-later