From dea650042b9dac6ad4a148ddfd5d7c0ee3c412d8 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Wed, 6 May 2020 22:32:35 +0900 Subject: [PATCH 01/15] Update README for v1 branch --- README.ja.md | 30 ++---------------------------- README.md | 31 +++---------------------------- 2 files changed, 5 insertions(+), 56 deletions(-) diff --git a/README.ja.md b/README.ja.md index efe7880b..8a72d1c1 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,3 +1,5 @@ +**お知らせ**: これはGNU Emacs 24.3, 24.4, 24.5, 25.1のためのメンテナンスブランチです。もしこれらのバージョンの保守を継続したければ気軽にこのブランチ(`v1`)にプルリクエストを送ってください。 +

Emacs PHP Mode

@@ -5,8 +7,6 @@ [![lang: PHP 7](https://img.shields.io/badge/lang-PHP%207-brightgreen.svg)](http://php.net/manual/migration70.php) [![lang: PHP 5](https://img.shields.io/badge/lang-PHP%205-green.svg)](http://php.net/downloads.php) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) -[![melpa badge][melpa-badge]][melpa-link] -[![melpa stable badge][melpa-stable-badge]][melpa-stable-link] [![GPL v3](https://img.shields.io/badge/license-GPL_v3-green.svg)](http://www.gnu.org/licenses/gpl-3.0.txt) A powerful and flexible Emacs major mode for editing PHP scripts @@ -20,20 +20,6 @@ A powerful and flexible Emacs major mode for editing PHP scripts **PHP ModeはEmacs 24.3以降で動作します**。古いバージョンのEmacsでも動作するかもしれませんが、保証外です。 古いバージョンのEmacsのPHPモードを使用することによる問題のバグ報告は積極的に対応しません。現在のサポートポリシーは[Supported Version]のページをご覧ください。 -### **(推奨)** MELPAからのインストール - -[![melpa badge][melpa-badge]][melpa-link] [![melpa stable badge][melpa-stable-badge]][melpa-stable-link] - -GNU Emacs 24以降では、[package][]機能(または[Cask][])を使って[MELPA][]/[MELPA Stable][]からPHP Modeをインストールできます。 - -### OSのパッケージマネージャからのインストール - -PHP Modeは[いくつかのOSが提供するパッケージシステム][php-mode-packages]からインストール可能です。DebianおよびUbuntuのようなDebian派生のOSではEmacsにPHPを追加する最も簡単な方法で、`sudo apt install elpa-php-mode` で導入できます。これらの "Stable" リリースは最新のPHP Modeよりも古いものの、十分にテストされた固定バージョンが提供されます。オートロードとバイトコンパイルは自動で行われます。 - -最新のPHP Modeの機能とパフォーマンス改善を活用するために**sid** ("unstable"としても知られるローリングリリース)で提供されるバージョンのインストールを検討してください。最新バージョンは[`elpa-php-mode`][elpa-php-mode]にあります。"apt-pinning"を使ってアップデートを自動化することもできます。 - -また、[Debian 9 (stretch)][php-elisp-stretch]や[Ubuntu 18.10][php-elisp-ubuntu1810]以前で提供されていた `php-elisp` パッケージは[あまりにも古い][issue-430]ので、 **くれぐれもインストールしないでください**。 - ### 手動でインストール もしパッケージマネージャに依存したくなければ、伝統的な方法によってLispファイルを直接インストールすることもできます。詳細なセットアップ方法は[手動でのインストール][wiki-manual-installation-ja]ページをご覧ください。 @@ -329,24 +315,12 @@ PHP Modeは[GNU General Public License Version 3][gpl-v3] (GPLv3) でライセ [Authors]: https://github.com/emacs-php/php-mode/wiki/Authors [Cask]: https://github.com/cask/cask [Contributors]: https://github.com/emacs-php/php-mode/graphs/contributors -[MELPA Stable]: https://stable.melpa.org/ -[MELPA]: https://melpa.org/ [Subword Mode]: https://www.gnu.org/software/emacs/manual/html_node/ccmode/Subword-Movement.html [Supported Version]: https://github.com/emacs-php/php-mode/wiki/Supported-Version [Web Mode]: http://web-mode.org/ [camelCase]: https://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%83%A1%E3%83%AB%E3%82%B1%E3%83%BC%E3%82%B9 [cc mode]: https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html -[elpa-php-mode]: https://packages.debian.org/sid/elpa-php-mode [gpl-v3]: https://www.gnu.org/licenses/quick-guide-gplv3.html -[issue-430]: https://github.com/emacs-php/php-mode/issues/430 -[melpa-badge]: http://melpa.org/packages/php-mode-badge.svg -[melpa-link]: http://melpa.org/#/php-mode -[melpa-stable-badge]: http://stable.melpa.org/packages/php-mode-badge.svg -[melpa-stable-link]: http://stable.melpa.org/#/php-mode -[package]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Packages.html -[php-elisp-stretch]: https://packages.debian.org/stretch/php-elisp -[php-elisp-ubuntu1810]: https://packages.ubuntu.com/cosmic/php-elisp -[php-mode-packages]: https://repology.org/project/emacs:php-mode/versions [php-mode]: https://github.com/emacs-php/php-mode [php-suite]: https://github.com/emacs-php/php-suite [wiki]: https://github.com/emacs-php/php-mode/wiki diff --git a/README.md b/README.md index f3302a19..c5ae8d28 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +**NOTE**: This is maintenance branch for GNU Emacs 24.3, 24.4, 24.5, 25.1. If you want to continue supporting these versions, feel free to send a Pull Request to this branch (`v1`). + +

Emacs PHP Mode

@@ -5,8 +8,6 @@ [![lang: PHP 7](https://img.shields.io/badge/lang-PHP%207-brightgreen.svg)](http://php.net/manual/migration70.php) [![lang: PHP 5](https://img.shields.io/badge/lang-PHP%205-green.svg)](http://php.net/downloads.php) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) -[![melpa badge][melpa-badge]][melpa-link] -[![melpa stable badge][melpa-stable-badge]][melpa-stable-link] [![GPL v3](https://img.shields.io/badge/license-GPL_v3-green.svg)](http://www.gnu.org/licenses/gpl-3.0.txt) A powerful and flexible Emacs major mode for editing PHP scripts @@ -22,20 +23,6 @@ Installation The current support policy can be found on the [Supported Version] page. -### **(RECOMMENDED)** Install from MELPA - -[![melpa badge][melpa-badge]][melpa-link] [![melpa stable badge][melpa-stable-badge]][melpa-stable-link] - -With GNU Emacs 24 or later then you can use its [package][] feature (or [Cask][]) to install PHP Mode from [MELPA][] or [MELPA Stable][]. - -### Install using OS package system - -PHP Mode is available from [package systems provided by several OSs][php-mode-packages]. On Debian, and operating systems derived from it, such as Ubuntu, the easiest way to add PHP support to Emacs is `sudo apt install elpa-php-mode`. "Stable" releases of these operating systems include a well-tested frozen version of this package that is always older than the latest upstream version of PHP Mode. Autoloads and byte-compilation are automatic. - -Please consider installing the package provided in `sid` (aka: "unstable", a rolling release) in order to benefit from the latest PHP Mode features and performance improvements. The latest version can be found here: [`elpa-php-mode`][elpa-php-mode]. Investigate "apt-pinning" to make tracking this update stream automatic. - -Also, the `php-elisp` package provided by [Debian 9 (stretch)][php-elisp-stretch] and [Ubuntu 18.10][php-elisp-ubuntu1810] and earlier is [extremely old][issue-430], so **PLEASE DO NOT INSTALL IT**. - ### Manual installation If you don't want to depend on a package manager, you can install Lisp files directly in the traditional way. See [Manual installation][wiki-manual-installation] for our recommended setup method. @@ -309,24 +296,12 @@ This project was maintained by [Eric James Michael Ritz][@ejmr] until 2017. Curr [Authors]: https://github.com/emacs-php/php-mode/wiki/Authors [Cask]: https://github.com/cask/cask [Contributors]: https://github.com/emacs-php/php-mode/graphs/contributors -[MELPA Stable]: https://stable.melpa.org/ -[MELPA]: https://melpa.org/ [Subword Mode]: https://www.gnu.org/software/emacs/manual/html_node/ccmode/Subword-Movement.html [Supported Version]: https://github.com/emacs-php/php-mode/wiki/Supported-Version [Web Mode]: http://web-mode.org/ [camelCase]: https://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%83%A1%E3%83%AB%E3%82%B1%E3%83%BC%E3%82%B9 [cc mode]: https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html -[elpa-php-mode]: https://packages.debian.org/sid/elpa-php-mode [gpl-v3]: https://www.gnu.org/licenses/quick-guide-gplv3.html -[issue-430]: https://github.com/emacs-php/php-mode/issues/430 -[melpa-badge]: http://melpa.org/packages/php-mode-badge.svg -[melpa-link]: http://melpa.org/#/php-mode -[melpa-stable-badge]: http://stable.melpa.org/packages/php-mode-badge.svg -[melpa-stable-link]: http://stable.melpa.org/#/php-mode -[package]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Packages.html -[php-elisp-stretch]: https://packages.debian.org/stretch/php-elisp -[php-elisp-ubuntu1810]: https://packages.ubuntu.com/cosmic/php-elisp -[php-mode-packages]: https://repology.org/project/emacs:php-mode/versions [php-mode]: https://github.com/emacs-php/php-mode [php-suite]: https://github.com/emacs-php/php-suite [wiki]: https://github.com/emacs-php/php-mode/wiki From ba80b3aabea3bb0b590b38bc524f40ced1841e17 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 25 Jul 2020 17:41:11 +0900 Subject: [PATCH 02/15] Fix regexp where characters following logical negation are not font-locked --- php-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-mode.el b/php-mode.el index 71eca1a7..1f2ecca4 100644 --- a/php-mode.el +++ b/php-mode.el @@ -1518,7 +1518,7 @@ a completion list." ("\\<\\(const\\)\\s-+\\(\\_<.+?\\_>\\)" (1 'php-keyword) (2 'php-constant-assign)) ;; Logical operator (!) - ("\\(![^=]\\)" 1 'php-logical-op) + ("\\(!\\)[^=]" 1 'php-logical-op) ;; Highlight special variables ("\\(\\$\\)\\(this\\)\\>" (1 'php-$this-sigil) (2 'php-$this)) From 8eb897f2acc644d2d2387654addb233c778e3b78 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Mon, 8 Jun 2020 00:59:12 +0900 Subject: [PATCH 03/15] Use sort command in LANG=C --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 682675df..a3937e88 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ AUTHORS.md: AUTHORS.md.in @printf "Generating AUTHORS.md file..." @test -d .git \ && (cat $< > $@ \ - && git log --pretty=format:'- %aN' | sort -u >> $@ \ + && git log --pretty=format:'- %aN' | LANG=C sort -u >> $@ \ && printf "FINISHED\n" ; ) \ || printf "FAILED (non-fatal)\n" From ea264f83a503afcd90e3ac51eb7ce4369d7bd86d Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Mon, 8 Jun 2020 23:03:38 +0900 Subject: [PATCH 04/15] This file is unused and will no longer be used --- php-util-buffer.el | 135 --------------------------------------------- 1 file changed, 135 deletions(-) delete mode 100644 php-util-buffer.el diff --git a/php-util-buffer.el b/php-util-buffer.el deleted file mode 100644 index e287983f..00000000 --- a/php-util-buffer.el +++ /dev/null @@ -1,135 +0,0 @@ -;;; php-util-buffer.el --- Utility function for buffer manipulation -*- lexical-binding: t; -*- - -;; Copyright (C) 2020 Friends of Emacs-PHP development -;; Copyright 2013 The go-mode Authors. All rights reserved. - -;; Author: Dominik Honnef -;; Maintainer: USAMI Kenta -;; URL: https://github.com/emacs-php/php-mode -;; Keywords: lisp - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Functions for patching buffer. - -;;; Original License: - -;; Copyright (c) 2014 The go-mode Authors. All rights reserved. - -;; Redistribution and use in source and binary forms, with or without -;; modification, are permitted provided that the following conditions are -;; met: - -;; * Redistributions of source code must retain the above copyright -;; notice, this list of conditions and the following disclaimer. -;; * Redistributions in binary form must reproduce the above -;; copyright notice, this list of conditions and the following disclaimer -;; in the documentation and/or other materials provided with the -;; distribution. -;; * Neither the name of the copyright holder nor the names of its -;; contributors may be used to endorse or promote products derived from -;; this software without specific prior written permission. - -;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -;;; Code: - -;; gofmt apply-rcs-patch Function -;; These functions are copied by go-mode(gofmt). -(defun php-util-buffer--delete-whole-line (&optional arg) - "Delete the current line without putting it in the `kill-ring'. -Derived from function `kill-whole-line'. ARG is defined as for that -function." - (setq arg (or arg 1)) - (if (and (> arg 0) - (eobp) - (save-excursion (forward-visible-line 0) (eobp))) - (signal 'end-of-buffer nil)) - (if (and (< arg 0) - (bobp) - (save-excursion (end-of-visible-line) (bobp))) - (signal 'beginning-of-buffer nil)) - (cond ((zerop arg) - (delete-region (progn (forward-visible-line 0) (point)) - (progn (end-of-visible-line) (point)))) - ((< arg 0) - (delete-region (progn (end-of-visible-line) (point)) - (progn (forward-visible-line (1+ arg)) - (unless (bobp) - (backward-char)) - (point)))) - (t - (delete-region (progn (forward-visible-line 0) (point)) - (progn (forward-visible-line arg) (point)))))) - -(defun php-util-buffer-apply-rcs-patch (target-buffer patch-buffer) - "Apply an RCS-formatted diff from `PATCH-BUFFER' to the `TARGET-BUFFER'." - (let ( - ;; Relative offset between buffer line numbers and line numbers - ;; in patch. - ;; - ;; Line numbers in the patch are based on the source file, so - ;; we have to keep an offset when making changes to the - ;; buffer. - ;; - ;; Appending lines decrements the offset (possibly making it - ;; negative), deleting lines increments it. This order - ;; simplifies the forward-line invocations. - (line-offset 0) - (column (current-column))) - (save-excursion - (with-current-buffer patch-buffer - (goto-char (point-min)) - (while (not (eobp)) - (unless (looking-at "^\\([ad]\\)\\([0-9]+\\) \\([0-9]+\\)") - (error "Invalid rcs patch or internal error in php-util-buffer-apply-rcs-patch")) - (forward-line) - (let ((action (match-string 1)) - (from (string-to-number (match-string 2))) - (len (string-to-number (match-string 3)))) - (cond - ((equal action "a") - (let ((start (point))) - (forward-line len) - (let ((text (buffer-substring start (point)))) - (with-current-buffer target-buffer - (cl-decf line-offset len) - (goto-char (point-min)) - (forward-line (- from len line-offset)) - (insert text))))) - ((equal action "d") - (with-current-buffer target-buffer - (goto-char (point-min)) - (forward-line (1- (- from line-offset))) - (cl-incf line-offset len) - (php-util-buffer--delete-whole-line len))) - (t - (error "Invalid rcs patch or internal error in php-util-buffer--apply-rcs-patch"))))))) - (move-to-column column))) -;; Copy of go-mode.el ends here - -(provide 'php-util-buffer) -;;; php-util-buffer.el ends here From 8331c50450f2b4845ebdec730b74254d89c1f18e Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sun, 26 Jul 2020 02:51:10 +0900 Subject: [PATCH 05/15] Add mixed type "mixed" type declare is added in PHP 8.0. https://wiki.php.net/rfc/mixed_type_v2 --- php-mode.el | 2 +- tests/lang/types/keywords.php | 1 + tests/lang/types/keywords.php.faces | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/php-mode.el b/php-mode.el index 1f2ecca4..b1c020c8 100644 --- a/php-mode.el +++ b/php-mode.el @@ -472,7 +472,7 @@ In that case set to `NIL'." (c-lang-defconst c-primitive-type-kwds php '("int" "integer" "bool" "boolean" "float" "double" "real" - "string" "object" "void")) + "string" "object" "void" "mixed")) (c-lang-defconst c-class-decl-kwds "Keywords introducing declarations where the following block (if any) diff --git a/tests/lang/types/keywords.php b/tests/lang/types/keywords.php index fc1b4f66..e9ba7785 100644 --- a/tests/lang/types/keywords.php +++ b/tests/lang/types/keywords.php @@ -12,3 +12,4 @@ string; object; resource; +mixed; diff --git a/tests/lang/types/keywords.php.faces b/tests/lang/types/keywords.php.faces index 465e035f..32d205a9 100644 --- a/tests/lang/types/keywords.php.faces +++ b/tests/lang/types/keywords.php.faces @@ -20,4 +20,6 @@ ("string" . font-lock-type-face) (";\n") ("object" . font-lock-type-face) - (";\nresource;\n")) + (";\nresource;\n") + ("mixed" . font-lock-type-face) + (";\n")) From c4fb921874f5069b6e6aa785413f8582b7a4d083 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Fri, 31 Jul 2020 04:42:08 +0900 Subject: [PATCH 06/15] Use files instead of package-file without php-mode.el It is not necessary to specify in package-file except the main file of the package. --- Cask | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Cask b/Cask index 49af2fb6..a37bc60b 100644 --- a/Cask +++ b/Cask @@ -1,11 +1,13 @@ (package "php-mode" "1.23.0" "Major mode for editing PHP code") (source melpa) -(package-file "php.el") -(package-file "php-face.el") (package-file "php-mode.el") -(package-file "php-project.el") -(package-file "php-mode-debug.el") + +(files + "php.el" + "php-face.el" + "php-project.el" + "php-mode-debug.el") (development (depends-on "pkg-info") From f2e6877b802f3e70134a745726dcf7d9a64c0cec Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Fri, 31 Jul 2020 04:40:38 +0900 Subject: [PATCH 07/15] Remove redundant Package-Requires header --- php-align.el | 1 - php-face.el | 1 - php-mode-debug.el | 1 - php-project.el | 1 - php.el | 1 - 5 files changed, 5 deletions(-) diff --git a/php-align.el b/php-align.el index 084f8857..648ceac0 100644 --- a/php-align.el +++ b/php-align.el @@ -8,7 +8,6 @@ ;; Keywords: php languages convenience align ;; Homepage: https://github.com/emacs-php/php-mode ;; Version: 1.23.0 -;; Package-Requires: ((emacs "24.3")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/php-face.el b/php-face.el index cb6a95f9..ac6f48da 100644 --- a/php-face.el +++ b/php-face.el @@ -7,7 +7,6 @@ ;; Version: 1.23.0 ;; Keywords: faces, php ;; Homepage: https://github.com/emacs-php/php-mode -;; Package-Requires: ((emacs "24.3")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/php-mode-debug.el b/php-mode-debug.el index 1e75aa15..01f02a04 100644 --- a/php-mode-debug.el +++ b/php-mode-debug.el @@ -6,7 +6,6 @@ ;; URL: https://github.com/emacs-php/php-mode ;; Keywords: maint ;; Version: 1.23.0 -;; Package-Requires: ((emacs "24.3")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/php-project.el b/php-project.el index 6e305a7b..5f4236d1 100644 --- a/php-project.el +++ b/php-project.el @@ -6,7 +6,6 @@ ;; Keywords: tools, files ;; URL: https://github.com/emacs-php/php-mode ;; Version: 1.23.0 -;; Package-Requires: ((emacs "24.3")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/php.el b/php.el index ce532c17..e417fa18 100644 --- a/php.el +++ b/php.el @@ -7,7 +7,6 @@ ;; Version: 1.23.0 ;; Keywords: languages, php ;; Homepage: https://github.com/emacs-php/php-mode -;; Package-Requires: ((emacs "24.3")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify From 399cf7f7001579de1da71a48de46fab8058bf816 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sun, 26 Jul 2020 02:22:47 +0900 Subject: [PATCH 08/15] Support PHP 8 match expression https://wiki.php.net/rfc/match_expression_v2 refs https://github.com/emacs-php/php-mode/issues/631 Suppress lint error for c-looking-at-or-maybe-in-bracelist --- php-mode.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/php-mode.el b/php-mode.el index b1c020c8..d58faa00 100644 --- a/php-mode.el +++ b/php-mode.el @@ -519,6 +519,9 @@ PHP does not have an \"enum\"-like keyword." (c-lang-defconst c-lambda-kwds php '("function" "use")) +(c-lang-defconst c-inexpr-block-kwds + php '("match")) + (c-lang-defconst c-other-block-decl-kwds php '("namespace")) @@ -643,6 +646,23 @@ but only if the setting is enabled" (beginning-of-line) (if (looking-at-p "\\s-*->") '+ nil)))) +(defun php-c-looking-at-or-maybe-in-bracelist (&optional containing-sexp lim) + "Replace `c-looking-at-or-maybe-in-bracelist'. + +CONTAINING-SEXP is the position of the brace/paren/bracket enclosing +POINT, or nil if there is no such position, or we do not know it. LIM is +a backward search limit." + (cond + ((looking-at-p "{") + (save-excursion + (c-backward-token-2 2 t lim) + ;; PHP 8.0 match expression + ;; echo match ($var) |{ + ;; ↑ matches ↑ initial position + (when (looking-at-p (eval-when-compile (rx symbol-start "match" symbol-end))) + (cons (point) t)))) + (t nil))) + (c-add-style "php" `((c-basic-offset . 4) @@ -1186,6 +1206,10 @@ After setting the stylevars run hooks according to STYLENAME (setq-local add-log-current-defun-function nil) (setq-local add-log-current-defun-header-regexp php-beginning-of-defun-regexp) + (when (fboundp 'c-looking-at-or-maybe-in-bracelist) + (advice-add #'c-looking-at-or-maybe-in-bracelist + :override 'php-c-looking-at-or-maybe-in-bracelist)) + (when (>= emacs-major-version 25) (with-silent-modifications (save-excursion From 5f31f977652cf6e19d09d2c5257d1ca163da1ef2 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sun, 26 Jul 2020 03:22:09 +0900 Subject: [PATCH 09/15] Move .mailmap and AUTHORS.md.in into etc/git/ dir --- .gitignore | 1 + Makefile | 5 ++++- .mailmap => etc/git/.mailmap | 0 AUTHORS.md.in => etc/git/AUTHORS.md.in | 0 4 files changed, 5 insertions(+), 1 deletion(-) rename .mailmap => etc/git/.mailmap (100%) rename AUTHORS.md.in => etc/git/AUTHORS.md.in (100%) diff --git a/.gitignore b/.gitignore index 8d42011c..f9278324 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.cask/ +/.mailmap /php-mode-autoloads.el *~ *.elc diff --git a/Makefile b/Makefile index a3937e88..dc40c85b 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,11 @@ all: autoloads $(ELCS) authors authors: AUTHORS.md +.mailmap: + ln -s etc/git/.mailmap + .PHONY: AUTHORS.md -AUTHORS.md: AUTHORS.md.in +AUTHORS.md: etc/git/AUTHORS.md.in .mailmap @printf "Generating AUTHORS.md file..." @test -d .git \ && (cat $< > $@ \ diff --git a/.mailmap b/etc/git/.mailmap similarity index 100% rename from .mailmap rename to etc/git/.mailmap diff --git a/AUTHORS.md.in b/etc/git/AUTHORS.md.in similarity index 100% rename from AUTHORS.md.in rename to etc/git/AUTHORS.md.in From 4d3b1069bdcd4dba2fa301a3b19c7fc26aa807c5 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Fri, 31 Jul 2020 04:38:30 +0900 Subject: [PATCH 10/15] Set package-lint-main-file for package-lint --- .dir-locals.el | 1 + tests/.dir-locals.el | 1 + 2 files changed, 2 insertions(+) create mode 100644 .dir-locals.el create mode 100644 tests/.dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 00000000..f3f3a384 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1 @@ +((emacs-lisp-mode (package-lint-main-file . "php-mode.el"))) diff --git a/tests/.dir-locals.el b/tests/.dir-locals.el new file mode 100644 index 00000000..d18ca3ff --- /dev/null +++ b/tests/.dir-locals.el @@ -0,0 +1 @@ +((emacs-lisp-mode (package-lint-main-file . "../php-mode.el"))) From a655bc27aac3c3069fd2f631fee11455524f8cb3 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Tue, 11 Aug 2020 20:54:30 +0900 Subject: [PATCH 11/15] Add Emacs 27.1 to GitHub Actions CI --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd240b6b..de843d4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,7 @@ jobs: - "26.1" - "26.2" - "26.3" + - "27.1" - snapshot include: - emacs_version: snapshot From a87475a512ec51a24dcc0510d97273aaeee12afc Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Tue, 11 Aug 2020 20:55:58 +0900 Subject: [PATCH 12/15] Update Emacs badge --- README.ja.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index 8a72d1c1..ddf75472 100644 --- a/README.ja.md +++ b/README.ja.md @@ -3,7 +3,7 @@

Emacs PHP Mode

-[![Emacs: 26.3](https://img.shields.io/badge/Emacs-26.3-blue.svg)](https://www.gnu.org/software/emacs/) +[![Emacs: 27.1](https://img.shields.io/badge/Emacs-27.1-blue.svg)](https://www.gnu.org/software/emacs/) [![lang: PHP 7](https://img.shields.io/badge/lang-PHP%207-brightgreen.svg)](http://php.net/manual/migration70.php) [![lang: PHP 5](https://img.shields.io/badge/lang-PHP%205-green.svg)](http://php.net/downloads.php) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) diff --git a/README.md b/README.md index c5ae8d28..533f9888 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

Emacs PHP Mode

-[![Emacs: 26.3](https://img.shields.io/badge/Emacs-26.3-blue.svg)](https://www.gnu.org/software/emacs/) +[![Emacs: 27.1](https://img.shields.io/badge/Emacs-27.1-blue.svg)](https://www.gnu.org/software/emacs/) [![lang: PHP 7](https://img.shields.io/badge/lang-PHP%207-brightgreen.svg)](http://php.net/manual/migration70.php) [![lang: PHP 5](https://img.shields.io/badge/lang-PHP%205-green.svg)](http://php.net/downloads.php) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) From 623ad520b99b3f87cea12ae10dc439383813a3aa Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Wed, 12 Aug 2020 21:04:44 +0900 Subject: [PATCH 13/15] Add php-mode-pkg.el for v1 branch --- php-mode-pkg.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 php-mode-pkg.el diff --git a/php-mode-pkg.el b/php-mode-pkg.el new file mode 100644 index 00000000..5ca80ccf --- /dev/null +++ b/php-mode-pkg.el @@ -0,0 +1,12 @@ +(define-package "php-mode" "1.23.0" "Major mode for editing PHP code" + '((emacs "24.3")) + :keywords + '("languages" "php") + :authors + '(("Eric James Michael Ritz")) + :maintainer + '("USAMI Kenta" . "tadsan@zonu.me") + :url "https://github.com/emacs-php/php-mode") +;; Local Variables: +;; no-byte-compile: t +;; End: From 4c44cdc69688a24438228a3c9bd5ce8972e7d44e Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 11 Sep 2020 08:27:44 +0200 Subject: [PATCH 14/15] Use new variable name for deprecated "php-lineup-cascaded-calls" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 533f9888..2de8b0c5 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ $object->foo() ->baz(); ``` -This behaviour is off by default, but you can customize the variable `php-lineup-cascaded-calls` to enable this. +This behaviour is off by default, but you can customize the variable `php-mode-lineup-cascaded-calls` to enable this. **Note:** Alignment will only work if you use one of the php-mode coding styles or inherit one of the styles. From e50cc247ee1fdfb2eaa91a45ea099b497df0766a Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 21 Nov 2020 02:50:18 +0900 Subject: [PATCH 15/15] Add Christian Weiske to AUTHORS.md --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 6a9e4335..aa263198 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -30,6 +30,7 @@ Names Sorted Alphabetically: - Carl Groner - Charlie McMackin - Christian Albrecht +- Christian Weiske - Daniel Hackney - David Arroyo Menéndez - David Maus