|
| 1 | +;;; php-cc-mode.el --- Compatibility alias for the CC Mode based php-mode -*- lexical-binding: t; -*- |
| 2 | + |
| 3 | +;; Copyright (C) 2026 Friends of Emacs-PHP development |
| 4 | + |
| 5 | +;; Author: USAMI Kenta <tadsan@zonu.me> |
| 6 | +;; Maintainer: USAMI Kenta <tadsan@zonu.me> |
| 7 | +;; URL: https://github.com/emacs-php/php-mode |
| 8 | +;; Keywords: languages php |
| 9 | +;; License: GPL-3.0-or-later |
| 10 | + |
| 11 | +;; This program is free software; you can redistribute it and/or modify |
| 12 | +;; it under the terms of the GNU General Public License as published by |
| 13 | +;; the Free Software Foundation, either version 3 of the License, or |
| 14 | +;; (at your option) any later version. |
| 15 | + |
| 16 | +;; This program is distributed in the hope that it will be useful, |
| 17 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | +;; GNU General Public License for more details. |
| 20 | + |
| 21 | +;; You should have received a copy of the GNU General Public License |
| 22 | +;; along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 23 | + |
| 24 | +;;; Commentary: |
| 25 | + |
| 26 | +;; This file is a forward-compatibility shim introduced while PHP Mode is |
| 27 | +;; being reworked to no longer depend on CC Mode. |
| 28 | +;; |
| 29 | +;; In the target design, the CC Mode based implementation is renamed to |
| 30 | +;; `php-cc-mode' and the name `php-mode' is reused for a cc-mode |
| 31 | +;; independent major mode. During the transition `php-mode' (in |
| 32 | +;; php-mode.el) is still the CC Mode based implementation, so this file |
| 33 | +;; only establishes the *names* that code will migrate to, without |
| 34 | +;; changing any behavior: |
| 35 | +;; |
| 36 | +;; - `php-cc-mode' is provided as an alias for `php-mode', so that |
| 37 | +;; configuration or third-party code written against the new name |
| 38 | +;; works now and keeps working after the eventual swap. |
| 39 | +;; - Variable names that will belong to `php-cc-mode' are provided as |
| 40 | +;; aliases of their current `php-mode-*' counterparts. |
| 41 | +;; |
| 42 | +;; Loading this file has no effect on `php-mode' itself: it does not |
| 43 | +;; register any `auto-mode-alist' / `interpreter-mode-alist' entry, and |
| 44 | +;; it does not redefine `php-mode'. It is intentionally kept out of the |
| 45 | +;; `php-mode' require graph and is loaded only when something asks for |
| 46 | +;; `php-cc-mode'. |
| 47 | + |
| 48 | +;;; Code: |
| 49 | + |
| 50 | +(require 'php-mode) |
| 51 | + |
| 52 | +;;;###autoload |
| 53 | +(defalias 'php-cc-mode 'php-mode |
| 54 | + "Major mode for editing PHP code, based on CC Mode. |
| 55 | +
|
| 56 | +This is currently an alias for `php-mode'. It exists so that code can |
| 57 | +already refer to the CC Mode based implementation by the name it will |
| 58 | +keep (`php-cc-mode') once the default `php-mode' becomes the cc-mode |
| 59 | +independent implementation.") |
| 60 | + |
| 61 | +;; Hook: configuration hung on `php-cc-mode-hook' should run for the CC |
| 62 | +;; Mode based mode. While `php-cc-mode' is an alias for `php-mode', the |
| 63 | +;; hook is an alias too, so setting either one has the same effect. |
| 64 | +(defvaralias 'php-cc-mode-hook 'php-mode-hook |
| 65 | + "Hook run when entering `php-cc-mode'. |
| 66 | +Currently an alias for `php-mode-hook'.") |
| 67 | + |
| 68 | +;; Variables that will be owned by `php-cc-mode' in the target design. |
| 69 | +;; They are aliased to the current `php-mode-*' names so that either |
| 70 | +;; spelling works during the transition. |
| 71 | +(defvaralias 'php-cc-mode-lineup-cascaded-calls 'php-mode-lineup-cascaded-calls |
| 72 | + "Indent chained method calls to the previous line. |
| 73 | +Currently an alias for `php-mode-lineup-cascaded-calls'.") |
| 74 | + |
| 75 | +(defvaralias 'php-cc-mode-enable-backup-style-variables 'php-mode-enable-backup-style-variables |
| 76 | + "When non-nil, back up values set by hook and buffer local variables. |
| 77 | +Currently an alias for `php-mode-enable-backup-style-variables'.") |
| 78 | + |
| 79 | +(provide 'php-cc-mode) |
| 80 | +;;; php-cc-mode.el ends here |
0 commit comments