Skip to content

Commit 56b4ec4

Browse files
authored
Merge pull request #513 from emacs-php/split/php-face
Split php-face from php-mode
2 parents fa4a54f + a39bec7 commit 56b4ec4

File tree

4 files changed

+134
-102
lines changed

4 files changed

+134
-102
lines changed

Cask

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(source melpa)
33

44
(package-file "php.el")
5+
(package-file "php-face.el")
56
(package-file "php-mode.el")
67
(package-file "php-project.el")
78
(package-file "php-mode-debug.el")

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
EMACS ?= emacs
2-
ELS = php.el php-project.el php-mode.el php-mode-debug.el php-mode-test.el
2+
ELS = php.el php-face.el php-project.el php-mode.el php-mode-debug.el php-mode-test.el
33
AUTOLOADS = php-project-autoloads.el php-mode-autoloads.el
44
ELCS = $(ELS:.el=.elc)
55

@@ -10,7 +10,7 @@ all: autoloads $(ELCS)
1010

1111
autoloads: $(AUTOLOADS)
1212

13-
$(AUTOLOADS): php.el php-project.el php-mode-debug.el php-mode.el
13+
$(AUTOLOADS): php.el php-face.el php-project.el php-mode-debug.el php-mode.el
1414
$(EMACS) -Q -batch -L . --eval \
1515
"(progn \
1616
(require 'package) \

php-face.el

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
;;; php-face.el --- Face definitions for PHP script -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2019 Friends of Emacs-PHP development
4+
5+
;; Author: USAMI Kenta <tadsan@zonu.me>
6+
;; Created: 5 May 2019
7+
;; Version: 1.21.2
8+
;; Keywords: faces, php
9+
;; Homepage: https://github.com/emacs-php/php-mode
10+
;; Package-Requires: ((emacs "24.3"))
11+
;; License: GPL-3.0-or-later
12+
13+
;; This program is free software; you can redistribute it and/or modify
14+
;; it under the terms of the GNU General Public License as published by
15+
;; the Free Software Foundation, either version 3 of the License, or
16+
;; (at your option) any later version.
17+
18+
;; This program is distributed in the hope that it will be useful,
19+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
;; GNU General Public License for more details.
22+
23+
;; You should have received a copy of the GNU General Public License
24+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
25+
26+
;;; Commentary:
27+
28+
;; Face definitions for PHP script.
29+
30+
;;; Code:
31+
32+
;;;###autoload
33+
(defgroup php-faces nil
34+
"Faces used in PHP Mode"
35+
:tag "PHP Faces"
36+
:group 'php-mode
37+
:group 'faces)
38+
39+
(defface php-string '((t (:inherit font-lock-string-face)))
40+
"PHP Mode face used to highlight string literals."
41+
:group 'php-faces)
42+
43+
(defface php-keyword '((t (:inherit font-lock-keyword-face)))
44+
"PHP Mode face used to highlight keywords."
45+
:group 'php-faces)
46+
47+
(defface php-builtin '((t (:inherit font-lock-builtin-face)))
48+
"PHP Mode face used to highlight builtins."
49+
:group 'php-faces)
50+
51+
(defface php-function-name '((t (:inherit font-lock-function-name-face)))
52+
"PHP Mode face used to highlight function names."
53+
:group 'php-faces)
54+
55+
(defface php-function-call '((t (:inherit default)))
56+
"PHP Mode face used to highlight function names in calles."
57+
:group 'php-faces)
58+
59+
(defface php-method-call '((t (:inherit php-function-call)))
60+
"PHP Mode face used to highlight method names in calles."
61+
:group 'php-faces)
62+
63+
(defface php-static-method-call '((t (:inherit php-method-call)))
64+
"PHP Mode face used to highlight static method names in calles."
65+
:group 'php-faces)
66+
67+
(defface php-variable-name '((t (:inherit font-lock-variable-name-face)))
68+
"PHP Mode face used to highlight variable names."
69+
:group 'php-faces)
70+
71+
(defface php-property-name '((t (:inherit php-variable-name)))
72+
"PHP Mode face used to highlight property names."
73+
:group 'php-faces)
74+
75+
(defface php-variable-sigil '((t (:inherit default)))
76+
"PHP Mode face used to highlight variable sigils ($)."
77+
:group 'php-faces)
78+
79+
(defface php-object-op '((t (:inherit default)))
80+
"PHP Mode face used to object operators (->)."
81+
:group 'php-faces)
82+
83+
(defface php-paamayim-nekudotayim '((t (:inherit default)))
84+
"PHP Mode face used to highlight \"Paamayim Nekudotayim\" scope resolution operators (::)."
85+
:group 'php-faces)
86+
87+
(defface php-type '((t (:inherit font-lock-type-face)))
88+
"PHP Mode face used to highlight types."
89+
:group 'php-faces)
90+
91+
(defface php-constant '((t (:inherit font-lock-constant-face)))
92+
"PHP Mode face used to highlight constants."
93+
:group 'php-faces)
94+
95+
(defface php-$this '((t (:inherit php-constant)))
96+
"PHP Mode face used to highlight $this variables."
97+
:group 'php-faces)
98+
99+
(defface php-$this-sigil '((t (:inherit php-constant)))
100+
"PHP Mode face used to highlight sigils($) of $this variable."
101+
:group 'php-faces)
102+
103+
(defface php-php-tag '((t (:inherit font-lock-preprocessor-face)))
104+
"PHP Mode face used to highlight PHP tags."
105+
:group 'php-faces)
106+
107+
(defface php-doc-annotation-tag '((t . (:inherit font-lock-constant-face)))
108+
"Face used to highlight annotation tags in doc-comment."
109+
:group 'php-faces)
110+
111+
(defface php-doc-variable-sigil '((t (:inherit font-lock-variable-name-face)))
112+
"PHP Mode face used to highlight variable sigils($)."
113+
:group 'php-faces)
114+
115+
(defface php-doc-$this '((t (:inherit php-type)))
116+
"PHP Mode face used to highlight $this variable in doc-comment."
117+
:group 'php-faces)
118+
119+
(defface php-doc-$this-sigil '((t (:inherit php-type)))
120+
"PHP Mode face used to highlight sigil of $this variable in doc-comment."
121+
:group 'php-faces)
122+
123+
(defface php-doc-class-name '((t (:inherit php-string)))
124+
"Face used to class names in doc-comment."
125+
:group 'php-faces)
126+
127+
(define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")
128+
129+
(provide 'php-face)
130+
;;; php-face.el ends here

php-mode.el

Lines changed: 1 addition & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
;;; Code:
6565

6666
(require 'php)
67+
(require 'php-face)
6768
(require 'cc-mode)
6869
(require 'cc-langs)
6970

@@ -926,106 +927,6 @@ this ^ lineup"
926927
(easy-menu-define php-mode-menu php-mode-map "PHP Mode Commands"
927928
(cons "PHP" (c-lang-const c-mode-menu php)))
928929

929-
930-
;; Faces
931-
932-
;;;###autoload
933-
(defgroup php-faces nil
934-
"Faces used in PHP Mode"
935-
:tag "PHP Faces"
936-
:group 'php-mode
937-
:group 'faces)
938-
939-
(defface php-string '((t (:inherit font-lock-string-face)))
940-
"PHP Mode face used to highlight string literals."
941-
:group 'php-faces)
942-
943-
(defface php-keyword '((t (:inherit font-lock-keyword-face)))
944-
"PHP Mode face used to highlight keywords."
945-
:group 'php-faces)
946-
947-
(defface php-builtin '((t (:inherit font-lock-builtin-face)))
948-
"PHP Mode face used to highlight builtins."
949-
:group 'php-faces)
950-
951-
(defface php-function-name '((t (:inherit font-lock-function-name-face)))
952-
"PHP Mode face used to highlight function names."
953-
:group 'php-faces)
954-
955-
(defface php-function-call '((t (:inherit default)))
956-
"PHP Mode face used to highlight function names in calles."
957-
:group 'php-faces)
958-
959-
(defface php-method-call '((t (:inherit php-function-call)))
960-
"PHP Mode face used to highlight method names in calles."
961-
:group 'php-faces)
962-
963-
(defface php-static-method-call '((t (:inherit php-method-call)))
964-
"PHP Mode face used to highlight static method names in calles."
965-
:group 'php-faces)
966-
967-
(defface php-variable-name '((t (:inherit font-lock-variable-name-face)))
968-
"PHP Mode face used to highlight variable names."
969-
:group 'php-faces)
970-
971-
(defface php-property-name '((t (:inherit php-variable-name)))
972-
"PHP Mode face used to highlight property names."
973-
:group 'php-faces)
974-
975-
(defface php-variable-sigil '((t (:inherit default)))
976-
"PHP Mode face used to highlight variable sigils ($)."
977-
:group 'php-faces)
978-
979-
(defface php-object-op '((t (:inherit default)))
980-
"PHP Mode face used to object operators (->)."
981-
:group 'php-faces)
982-
983-
(defface php-paamayim-nekudotayim '((t (:inherit default)))
984-
"PHP Mode face used to highlight \"Paamayim Nekudotayim\" scope resolution operators (::)."
985-
:group 'php-faces)
986-
987-
(defface php-type '((t (:inherit font-lock-type-face)))
988-
"PHP Mode face used to highlight types."
989-
:group 'php-faces)
990-
991-
(defface php-constant '((t (:inherit font-lock-constant-face)))
992-
"PHP Mode face used to highlight constants."
993-
:group 'php-faces)
994-
995-
(defface php-$this '((t (:inherit php-constant)))
996-
"PHP Mode face used to highlight $this variables."
997-
:group 'php-faces)
998-
999-
(defface php-$this-sigil '((t (:inherit php-constant)))
1000-
"PHP Mode face used to highlight sigils($) of $this variable."
1001-
:group 'php-faces)
1002-
1003-
(defface php-php-tag '((t (:inherit font-lock-preprocessor-face)))
1004-
"PHP Mode face used to highlight PHP tags."
1005-
:group 'php-faces)
1006-
1007-
(defface php-doc-annotation-tag '((t . (:inherit font-lock-constant-face)))
1008-
"Face used to highlight annotation tags in doc-comment."
1009-
:group 'php-faces)
1010-
1011-
(defface php-doc-variable-sigil '((t (:inherit font-lock-variable-name-face)))
1012-
"PHP Mode face used to highlight variable sigils($)."
1013-
:group 'php-faces)
1014-
1015-
(defface php-doc-$this '((t (:inherit php-type)))
1016-
"PHP Mode face used to highlight $this variable in doc-comment."
1017-
:group 'php-faces)
1018-
1019-
(defface php-doc-$this-sigil '((t (:inherit php-type)))
1020-
"PHP Mode face used to highlight sigil of $this variable in doc-comment."
1021-
:group 'php-faces)
1022-
1023-
(defface php-doc-class-name '((t (:inherit php-string)))
1024-
"Face used to class names in doc-comment."
1025-
:group 'php-faces)
1026-
1027-
(define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")
1028-
1029930
(defvar-local php-mode--delayed-set-style nil)
1030931

1031932
(defun php-set-style (stylename &optional dont-override)

0 commit comments

Comments
 (0)