Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support poly-php-html-mode #539

Merged
merged 3 commits into from
May 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -820,13 +820,20 @@ example `html-mode'. Known such libraries are:\n\t"
nil))))

(defun php-cautious-indent-region (start end &optional quiet)
"Carefully indent region `START' `END' in contexts other than HTML templates.

If the optional argument `QUIET' is non-nil then no syntactic errors are
reported, even if `c-report-syntactic-errors' is non-nil."
(if (or (not php-mode-warn-if-mumamo-off)
(not (php-in-poly-php-html-mode))
php-warned-bad-indent
(php-check-html-for-indentation))
(funcall 'c-indent-region start end quiet)))

(defun php-cautious-indent-line ()
"Carefully indent lines in contexts other than HTML templates."
(if (or (not php-mode-warn-if-mumamo-off)
(not (php-in-poly-php-html-mode))
php-warned-bad-indent
(php-check-html-for-indentation))
(let ((here (point))
Expand Down
5 changes: 5 additions & 0 deletions php.el
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ it is the character that will terminate the string, or t if the string should be
"Return character address of start of comment or string; nil if not in one."
(nth 8 (syntax-ppss)))

(defsubst php-in-poly-php-html-mode ()
"Return T if current buffer is in `poly-html-mode'."
(and (boundp 'poly-php-html-mode)
(symbol-value 'poly-php-html-mode)))

(defun php-create-regexp-for-method (visibility)
"Make a regular expression for methods with the given VISIBILITY.

Expand Down