Skip to content

Commit 53b6835

Browse files
authored
Merge pull request #533 from emacs-php/fix/customize-tags
Add :tag for customization interface
2 parents 6a269f5 + 5365680 commit 53b6835

File tree

3 files changed

+90
-25
lines changed

3 files changed

+90
-25
lines changed

php-face.el

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,103 +38,128 @@
3838

3939
(defface php-string '((t (:inherit font-lock-string-face)))
4040
"PHP Mode face used to highlight string literals."
41-
:group 'php-faces)
41+
:group 'php-faces
42+
:tag "PHP String")
4243

4344
(defface php-keyword '((t (:inherit font-lock-keyword-face)))
4445
"PHP Mode face used to highlight keywords."
45-
:group 'php-faces)
46+
:group 'php-faces
47+
:tag "PHP Keyword")
4648

4749
(defface php-builtin '((t (:inherit font-lock-builtin-face)))
4850
"PHP Mode face used to highlight builtins."
49-
:group 'php-faces)
51+
:group 'php-faces
52+
:tag "PHP Built-in")
5053

5154
(defface php-function-name '((t (:inherit font-lock-function-name-face)))
5255
"PHP Mode face used to highlight function names."
53-
:group 'php-faces)
56+
:group 'php-faces
57+
:tag "PHP Function Name")
5458

5559
(defface php-function-call '((t (:inherit default)))
5660
"PHP Mode face used to highlight function names in calles."
57-
:group 'php-faces)
61+
:group 'php-faces
62+
:tag "PHP Function Call")
5863

5964
(defface php-method-call '((t (:inherit php-function-call)))
6065
"PHP Mode face used to highlight method names in calles."
61-
:group 'php-faces)
66+
:group 'php-faces
67+
:tag "PHP Method Call")
6268

6369
(defface php-static-method-call '((t (:inherit php-method-call)))
6470
"PHP Mode face used to highlight static method names in calles."
65-
:group 'php-faces)
71+
:group 'php-faces
72+
:tag "PHP Static Method Call")
6673

6774
(defface php-variable-name '((t (:inherit font-lock-variable-name-face)))
6875
"PHP Mode face used to highlight variable names."
69-
:group 'php-faces)
76+
:group 'php-faces
77+
:tag "PHP Variable Name")
7078

7179
(defface php-property-name '((t (:inherit php-variable-name)))
7280
"PHP Mode face used to highlight property names."
73-
:group 'php-faces)
81+
:group 'php-faces
82+
:tag "PHP Property Name")
7483

7584
(defface php-variable-sigil '((t (:inherit default)))
7685
"PHP Mode face used to highlight variable sigils ($)."
77-
:group 'php-faces)
86+
:group 'php-faces
87+
:tag "PHP Variable Sigil")
7888

7989
(defface php-object-op '((t (:inherit default)))
8090
"PHP Mode face used to object operators (->)."
81-
:group 'php-faces)
91+
:group 'php-faces
92+
:tag "PHP Object Op")
8293

8394
(defface php-paamayim-nekudotayim '((t (:inherit default)))
8495
"PHP Mode face used to highlight \"Paamayim Nekudotayim\" scope resolution operators (::)."
85-
:group 'php-faces)
96+
:group 'php-faces
97+
:tag "PHP Paamayim Nekudotayim")
8698

8799
(defface php-type '((t (:inherit font-lock-type-face)))
88100
"PHP Mode face used to highlight types."
89-
:group 'php-faces)
101+
:group 'php-faces
102+
:tag "PHP Type")
90103

91104
(defface php-constant '((t (:inherit font-lock-constant-face)))
92105
"PHP Mode face used to highlight constants."
93-
:group 'php-faces)
106+
:group 'php-faces
107+
:tag "PHP Constant")
94108

95109
(defface php-constant-assign '((t (:inherit font-lock-type-face)))
96110
"PHP Mode face used to highlight constant assigning (\"const\" statement)."
97-
:group 'php-faces)
111+
:group 'php-faces
112+
:tag "PHP Constant Assign")
98113

99114
(defface php-magical-constant '((t (:inherit font-lock-builtin-face)))
100115
"PHP Mode face used to highlight magical constants."
101-
:group 'php-faces)
116+
:group 'php-faces
117+
:tag "PHP Magical Constant")
102118

103119
(defface php-$this '((t (:inherit php-constant)))
104120
"PHP Mode face used to highlight $this variables."
105-
:group 'php-faces)
121+
:group 'php-faces
122+
:tag "PHP $this")
106123

107124
(defface php-$this-sigil '((t (:inherit php-constant)))
108125
"PHP Mode face used to highlight sigils($) of $this variable."
109-
:group 'php-faces)
126+
:group 'php-faces
127+
:tag "PHP $this Sigil")
110128

111129
(defface php-errorcontrol-op '((t (:inherit font-lock-type-face)))
112130
"PHP Mode face used to highlight errorcontrol operators (@).."
113-
:group 'php-face)
131+
:group 'php-faces
132+
:tag "PHP ErrorControl Op")
114133

115134
(defface php-php-tag '((t (:inherit font-lock-preprocessor-face)))
116135
"PHP Mode face used to highlight PHP tags."
117-
:group 'php-faces)
136+
:group 'php-faces
137+
:tag "PHP php Tag")
118138

119139
(defface php-doc-annotation-tag '((t . (:inherit font-lock-constant-face)))
120140
"Face used to highlight annotation tags in doc-comment."
121-
:group 'php-faces)
141+
:group 'php-faces
142+
:tag "PHPDoc Annotation Tag")
122143

123144
(defface php-doc-variable-sigil '((t (:inherit font-lock-variable-name-face)))
124145
"PHP Mode face used to highlight variable sigils($)."
125-
:group 'php-faces)
146+
:group 'php-faces
147+
:tag "PHPDoc Variable Sigil")
126148

127149
(defface php-doc-$this '((t (:inherit php-type)))
128150
"PHP Mode face used to highlight $this variable in doc-comment."
129-
:group 'php-faces)
151+
:group 'php-faces
152+
:tag "PHPDoc $this")
130153

131154
(defface php-doc-$this-sigil '((t (:inherit php-type)))
132155
"PHP Mode face used to highlight sigil of $this variable in doc-comment."
133-
:group 'php-faces)
156+
:group 'php-faces
157+
:tag "PHPDoc $this Sigil")
134158

135159
(defface php-doc-class-name '((t (:inherit php-string)))
136160
"Face used to class names in doc-comment."
137-
:group 'php-faces)
161+
:group 'php-faces
162+
:tag "PHPDoc Class Name")
138163

139164
(define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")
140165

php-mode.el

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@
136136
(defcustom php-mode-default-face 'default
137137
"Default face in `php-mode' buffers."
138138
:group 'php-mode
139+
:tag "PHP Mode Default Face"
139140
:type 'face)
140141

141142
(define-obsolete-variable-alias 'php-speedbar-config 'php-mode-speedbar-config "1.20.0")
142143
(defcustom php-mode-speedbar-config t
143144
"When set to true automatically configures Speedbar to observe PHP files.
144145
Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s345]?\\)\""
145146
:group 'php-mode
147+
:tag "PHP Mode Speedbar Config"
146148
:type 'boolean
147149
:set (lambda (sym val)
148150
(set-default sym val)
@@ -154,6 +156,7 @@ Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s345]?\\
154156
"Normally `php-mode' starts with the speedbar closed.
155157
Turning this on will open it whenever `php-mode' is loaded."
156158
:group 'php-mode
159+
:tag "PHP Mode Speedbar Open"
157160
:type 'boolean
158161
:set (lambda (sym val)
159162
(set-default sym val)
@@ -164,6 +167,7 @@ Turning this on will open it whenever `php-mode' is loaded."
164167
(defcustom php-mode-template-compatibility t
165168
"Should detect presence of html tags."
166169
:group 'php-mode
170+
:tag "PHP Mode Template Compatibility"
167171
:type 'boolean)
168172

169173
(defun php-mode-extra-constants-create-regexp (kwds)
@@ -194,13 +198,15 @@ of constants when set."
194198
(defcustom php-mode-lineup-cascaded-calls nil
195199
"Indent chained method calls to the previous line."
196200
:group 'php-mode
201+
:tag "PHP Mode Lineup Cascaded Calls"
197202
:type 'boolean)
198203

199204

200205
(define-obsolete-variable-alias 'php-extra-constants 'php-mode-extra-constants "1.20.0")
201206
(defcustom php-mode-extra-constants '()
202207
"A list of additional strings to treat as PHP constants."
203208
:group 'php-mode
209+
:tag "PHP Mode Extra Constants"
204210
:type '(repeat string)
205211
:set 'php-mode-extra-constants-set)
206212

@@ -213,6 +219,8 @@ set to `semantic-create-imenu-index' due to `c-mode' being its
213219
parent. Set this variable to t if you want to use
214220
`imenu-default-create-index-function' even with `semantic-mode'
215221
enabled."
222+
:group 'php-mode
223+
:tag "PHP Mode Do Not Use Semantic Imenu"
216224
:type 'boolean)
217225

218226
(defcustom php-completion-file ""
@@ -233,38 +241,54 @@ enabled."
233241

234242
(defcustom php-mode-hook nil
235243
"List of functions to be executed on entry to `php-mode'."
244+
:group 'php-mode
245+
:tag "PHP Mode Hook"
236246
:type 'hook)
237247

238248
(defcustom php-mode-pear-hook nil
239249
"Hook called when a PHP PEAR file is opened with `php-mode'."
250+
:group 'php-mode
251+
:tag "PHP Mode Pear Hook"
240252
:type 'hook)
241253

242254
(defcustom php-mode-drupal-hook nil
243255
"Hook called when a Drupal file is opened with `php-mode'."
256+
:group 'php-mode
257+
:tag "PHP Mode Drupal Hook"
244258
:type 'hook)
245259

246260
(defcustom php-mode-wordpress-hook nil
247261
"Hook called when a WordPress file is opened with `php-mode'."
262+
:group 'php-mode
263+
:tag "PHP Mode WordPress Hook"
248264
:type 'hook)
249265

250266
(defcustom php-mode-symfony2-hook nil
251267
"Hook called when a Symfony2 file is opened with `php-mode'."
268+
:group 'php-mode
269+
:tag "PHP Mode Symfony2 Hook"
252270
:type 'hook)
253271

254272
(defcustom php-mode-psr2-hook nil
255273
"Hook called when a PSR-2 file is opened with `php-mode'."
274+
:group 'php-mode
275+
:tag "PHP Mode PSR-2 Hook"
256276
:type 'hook)
257277

258278
(defcustom php-mode-force-pear nil
259279
"Normally PEAR coding rules are enforced only when the filename contains \"PEAR.\"
260280
Turning this on will force PEAR rules on all PHP files."
281+
:group 'php-mode
282+
:tag "PHP Mode Force Pear"
261283
:type 'boolean)
262284

263285
(defcustom php-mode-warn-if-mumamo-off t
264286
"Warn once per buffer if you try to indent a buffer without
265287
mumamo-mode turned on. Detects if there are any HTML tags in the
266288
buffer before warning, but this is is not very smart; e.g. if you
267289
have any tags inside a PHP string, it will be fooled."
290+
:group 'php-mode
291+
:tag "PHP Mode Warn If MuMaMo Off"
268292
:type '(choice (const :tag "Warn" t) (const "Don't warn" nil)))
269293

270294
(defcustom php-mode-coding-style 'pear
@@ -282,6 +306,8 @@ This variable can take one of the following symbol values:
282306
`Symfony2' - use coding styles preferred for working with Symfony2 projects.
283307
284308
`PSR-2' - use coding styles preferred for working with projects using PSR-2 standards."
309+
:group 'php-mode
310+
:tag "PHP Mode Coding Style"
285311
:type '(choice (const :tag "Default" default)
286312
(const :tag "PEAR" pear)
287313
(const :tag "Drupal" drupal)
@@ -297,18 +323,24 @@ This variable can take one of the following symbol values:
297323
298324
If you want to suppress styles from being overwritten by directory / file
299325
local variables, set NIL."
326+
:group 'php-mode
327+
:tag "PHP Mode Enable Project Coding Style"
300328
:type 'boolean)
301329

302330
(defcustom php-mode-enable-backup-style-variables t
303331
"When set to `T', back up values set by hook and buffer local variables.
304332
305333
This function may interfere with other hooks and other behaviors.
306334
In that case set to `NIL'."
335+
:group 'php-mode
336+
:tag "PHP Mode Enable Backup Style Variables"
307337
:type 'boolean)
308338

309339
(define-obsolete-variable-alias 'php-mode-disable-parent-mode-hooks 'php-mode-disable-c-mode-hook "1.21.0")
310340
(defcustom php-mode-disable-c-mode-hook t
311341
"When set to `T', do not run hooks of parent modes (`java-mode', `c-mode')."
342+
:group 'php-mode
343+
:tag "PHP Mode Disable C Mode Hook"
312344
:type 'boolean
313345
:group 'php-mode)
314346

@@ -1234,6 +1266,7 @@ current `tags-file-name'."
12341266
If non-nil, this shadows the value of `browse-url-browser-function' when
12351267
calling `php-search-documentation' or `php-search-local-documentation'."
12361268
:group 'php
1269+
:tag "PHP Search Documentation Browser Function"
12371270
:type '(choice (const :tag "default" nil) function)
12381271
:link '(variable-link browse-url-browser-function))
12391272

php.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,23 @@
4040

4141
(defcustom php-executable (or (executable-find "php") "/usr/bin/php")
4242
"The location of the PHP executable."
43+
:group 'php
44+
:tag "PHP Executable"
4345
:type 'string)
4446

4547
(defcustom php-site-url "https://php.net/"
4648
"Default PHP.net site URL.
4749
4850
The URL to use open PHP manual and search word."
51+
:group 'php
52+
:tag "PHP Site URL"
4953
:type 'string)
5054

5155
(defcustom php-manual-url 'en
5256
"URL at which to find PHP manual.
5357
You can replace \"en\" with your ISO language code."
58+
:group 'php
59+
:tag "PHP Manual URL"
5460
:type '(choice (const :tag "English" 'en)
5561
(const :tag "Brazilian Portuguese" 'pt_BR)
5662
(const :tag "Chinese (Simplified)" 'zh)
@@ -66,6 +72,7 @@ You can replace \"en\" with your ISO language code."
6672
(defcustom php-search-url nil
6773
"URL at which to search for documentation on a word."
6874
:group 'php
75+
:tag "PHP Search URL"
6976
:type '(choice (string :tag "URL to search PHP documentation")
7077
(const :tag "Use `php-site-url' variable" nil)))
7178

0 commit comments

Comments
 (0)