3838 (require 'cl-lib ))
3939(require 'cc-engine )
4040(require 'flymake )
41+ (require 'php-core )
4142(require 'php-project )
4243(require 'rx )
4344
44- ;;;### autoload
45- (defgroup php nil
46- " Language support for PHP."
47- :tag " PHP"
48- :group 'languages
49- :link '(url-link :tag " Official Site" " https://github.com/emacs-php/php-mode" )
50- :link '(url-link :tag " PHP Mode Wiki" " https://github.com/emacs-php/php-mode/wiki" ))
51-
52- (defcustom php-executable (or (executable-find " php" ) " php" )
53- " The location of the PHP executable."
54- :tag " PHP Executable"
55- :type 'string )
56-
5745(defcustom php-phpdbg-executable (list " phpdbg" )
5846 " The location of the PHPDBG executable."
47+ :group 'php
5948 :tag " PHP PHPDBG Executable"
6049 :type '(repeat string))
6150
6251(defcustom php-php-parse-executabe nil
6352 " The location of the php-parse executable."
53+ :group 'php
6454 :tag " PHP php-parse Executable"
6555 :type '(repeat string))
6656
6757(defcustom php-site-url " https://www.php.net/"
6858 " Default PHP.net site URL.
6959
7060The URL to use open PHP manual and search word."
61+ :group 'php
7162 :tag " PHP Site URL"
7263 :type 'string )
7364
7465(defcustom php-manual-url 'en
7566 " URL at which to find PHP manual.
7667You can replace \" en\" with your ISO language code."
68+ :group 'php
7769 :tag " PHP Manual URL"
7870 :type '(choice (const :tag " English" en)
7971 (const :tag " Brazilian Portuguese" pt_BR)
@@ -89,20 +81,24 @@ You can replace \"en\" with your ISO language code."
8981
9082(defcustom php-search-url nil
9183 " URL at which to search for documentation on a word."
84+ :group 'php
9285 :tag " PHP Search URL"
9386 :type '(choice (string :tag " URL to search PHP documentation" )
9487 (const :tag " Use `php-site-url' variable" nil )))
9588
9689(defcustom php-completion-file " "
9790 " Path to the file which contains the function names known to PHP."
91+ :group 'php
9892 :type 'string )
9993
10094(defcustom php-manual-path " "
10195 " Path to the directory which contains the PHP manual."
96+ :group 'php
10297 :type 'string )
10398
10499(defcustom php-search-documentation-function #'php-search-web-documentation
105100 " Function to search PHP Manual at cursor position."
101+ :group 'php
106102 :tag " PHP Search Documentation Function"
107103 :type '(choice (const :tag " Use online documentation" php-search-web-documentation)
108104 (const :tag " Use local documentation" php-local-manual-search)
@@ -113,6 +109,7 @@ You can replace \"en\" with your ISO language code."
113109
114110If non-nil, this shadows the value of `browse-url-browser-function' when
115111calling `php-search-documentation' or `php-search-local-documentation' ."
112+ :group 'php
116113 :tag " PHP Search Documentation Browser Function"
117114 :type '(choice (const :tag " default" nil ) function)
118115 :link '(variable-link browse-url-browser-function))
@@ -157,24 +154,29 @@ a completion list."
157154
158155(defcustom php-class-suffix-when-insert " ::"
159156 " Suffix for inserted class."
157+ :group 'php
160158 :type 'string )
161159
162160(defcustom php-namespace-suffix-when-insert " \\ "
163161 " Suffix for inserted namespace."
162+ :group 'php
164163 :type 'string )
165164
166165(defcustom php-default-major-mode 'php-mode
167166 " Major mode for editing PHP script."
167+ :group 'php
168168 :tag " PHP Default Major Mode"
169169 :type 'function )
170170
171171(defcustom php-html-template-major-mode 'web-mode
172172 " Major mode for editing PHP-HTML template."
173+ :group 'php
173174 :tag " PHP-HTML Template Major Mode"
174175 :type 'function )
175176
176177(defcustom php-blade-template-major-mode 'web-mode
177178 " Major mode for editing Blade template."
179+ :group 'php
178180 :tag " PHP Blade Template Major Mode"
179181 :type 'function )
180182
@@ -183,40 +185,47 @@ a completion list."
183185 (" \\ .phpt\\ '" . ,(if (fboundp 'phpt-mode ) 'phpt-mode php-default-major-mode))
184186 (" \\ .phtml\\ '" . ,php-html-template-major-mode ))
185187 " Automatically use another MAJOR-MODE when open template file."
188+ :group 'php
186189 :tag " PHP Template Mode Alist"
187190 :type '(alist :key-type regexp :value-type function)
188191 :link '(url-link :tag " web-mode" " http://web-mode.org/" )
189192 :link '(url-link :tag " phpt-mode" " https://github.com/emacs-php/phpt-mode" ))
190193
191194(defcustom php-mode-maybe-hook nil
192195 " List of functions to be executed on entry to `php-mode-maybe' ."
196+ :group 'php
193197 :tag " PHP Mode Maybe Hook"
194198 :type 'hook )
195199
196200(defcustom php-default-builtin-web-server-port 3939
197201 " Port number of PHP Built-in HTTP server (php -S)."
202+ :group 'php
198203 :tag " PHP Default Built-in Web Server Port"
199204 :type 'integer
200205 :link '(url-link :tag " Built-in web server"
201206 " https://www.php.net/manual/features.commandline.webserver.php" ))
202207
203208(defcustom php-topsy-separator " > "
204209 " Separator string for `php-topsy-beginning-of-defun-with-class' ."
210+ :group 'php
205211 :tag " PHP Topsy Separator"
206212 :type 'string )
207213
208214(defcustom php-function-call 'php-function-call-traditional
209215 " Face name to use for method call."
216+ :group 'php
210217 :tag " PHP Function Call"
211218 :type 'face )
212219
213220(defcustom php-method-call 'php-method-call-traditional
214221 " Face name to use for method call."
222+ :group 'php
215223 :tag " PHP Method Call"
216224 :type 'face )
217225
218226(defcustom php-static-method-call 'php-static-method-call-traditional
219227 " Face name to use for method call."
228+ :group 'php
220229 :tag " PHP Static Method Call"
221230 :type 'face )
222231
@@ -239,26 +248,6 @@ see https://www.php.net/manual/language.constants.predefined.php")
239248 " [" " ]" " (" " )" " {" " }" " ;" )
240249 t )))
241250
242- ; ;; Utillity for locate language construction
243- (defsubst php-in-string-p ()
244- " Return non-nil if inside a string.
245- It is the character that will terminate the string, or t if the string should
246- be terminated by a generic string delimiter."
247- (nth 3 (syntax-ppss )))
248-
249- (defsubst php-in-comment-p ()
250- " Return NIL if outside a comment, T if inside a non-nestable comment, else
251- an integer (the current comment nesting)."
252- (nth 4 (syntax-ppss )))
253-
254- (defsubst php-in-string-or-comment-p ()
255- " Return character address of start of comment or string; nil if not in one."
256- (nth 8 (syntax-ppss )))
257-
258- (defsubst php-in-poly-php-html-mode ()
259- " Return T if current buffer is in `poly-html-mode' ."
260- (bound-and-true-p poly-php-html-mode))
261-
262251(defconst php-beginning-of-defun-regexp
263252 (eval-when-compile
264253 (rx bol
@@ -451,6 +440,7 @@ can be used to match against definitions for that classlike."
451440
452441(defcustom php-imenu-generic-expression 'php-imenu-generic-expression-default
453442 " Default Imenu generic expression for PHP Mode. See `imenu-generic-expression' ."
443+ :group 'php
454444 :type '(choice (alist :key-type string :value-type (list string))
455445 (const php-imenu-generic-expression-legacy)
456446 (const php-imenu-generic-expression-simple)
@@ -599,6 +589,7 @@ Look at the `php-executable' variable instead of the constant \"php\" command."
599589
600590(defcustom php-re-detect-html-tag 'php-re-detect-html-tag-default
601591 " Regexp pattern variable-name of HTML detection."
592+ :group 'php
602593 :tag " PHP Re Detect HTML Tag"
603594 :type '(choice (const :tag " Default pattern" php-re-detect-html-tag-default)
604595 (const :tag " Aggressive pattern" php-re-detect-html-tag-aggressive)
@@ -653,14 +644,6 @@ indentation."
653644 (setq mode nil )))
654645 (or mode php-default-major-mode)))
655646
656- ;;;### autoload
657- (define-derived-mode php-base-mode prog-mode " PHP"
658- " Generic major mode for editing PHP.
659-
660- This mode is intended to be inherited by concrete major modes.
661- Currently there are `php-mode' and `php-ts-mode' ."
662- nil )
663-
664647;;;### autoload
665648(defun php-mode-maybe ()
666649 " Select PHP mode or other major mode."
0 commit comments