File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,26 @@ Look at the `php-executable' variable instead of the constant \"php\" command."
216
216
'flymake-php-init )))))
217
217
(list php-executable (cdr init))))
218
218
219
+ (defconst php-re-detect-html-tag
220
+ (eval-when-compile
221
+ (rx (or (: string-start (* (in space))
222
+ " <!"
223
+ (or " DOCTYPE" " doctype" )
224
+ (+ (in space))
225
+ (or " HTML" " html" ))
226
+ (: (or line-start
227
+ (: " <" (? " /" )
228
+ (* (in space)) (+ (in alpha " -" )) (* (in space)) " >" ))
229
+ (: " <" (* (in space)) (+ (in alpha " -" )) (* (in space)) " >" ))))))
230
+
231
+ (defun php-buffer-has-html-tag ()
232
+ " Return position of HTML tag or NIL in current buffer."
233
+ (save-excursion
234
+ (save-restriction
235
+ (widen )
236
+ (goto-char (point-min ))
237
+ (re-search-forward php-re-detect-html-tag nil t ))))
238
+
219
239
;;;### autoload
220
240
(defun php-mode-maybe ()
221
241
" Select PHP mode or other major mode."
You can’t perform that action at this time.
0 commit comments