Skip to content

Commit 5b0fe1b

Browse files
authored
Merge pull request #539 from emacs-php/support/poly-html-mode
Support poly-php-html-mode
2 parents 56704ae + 2b5963b commit 5b0fe1b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Diff for: php-mode.el

+7
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,20 @@ example `html-mode'. Known such libraries are:\n\t"
820820
nil))))
821821

822822
(defun php-cautious-indent-region (start end &optional quiet)
823+
"Carefully indent region `START' `END' in contexts other than HTML templates.
824+
825+
If the optional argument `QUIET' is non-nil then no syntactic errors are
826+
reported, even if `c-report-syntactic-errors' is non-nil."
823827
(if (or (not php-mode-warn-if-mumamo-off)
828+
(not (php-in-poly-php-html-mode))
824829
php-warned-bad-indent
825830
(php-check-html-for-indentation))
826831
(funcall 'c-indent-region start end quiet)))
827832

828833
(defun php-cautious-indent-line ()
834+
"Carefully indent lines in contexts other than HTML templates."
829835
(if (or (not php-mode-warn-if-mumamo-off)
836+
(not (php-in-poly-php-html-mode))
830837
php-warned-bad-indent
831838
(php-check-html-for-indentation))
832839
(let ((here (point))

Diff for: php.el

+5
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ it is the character that will terminate the string, or t if the string should be
108108
"Return character address of start of comment or string; nil if not in one."
109109
(nth 8 (syntax-ppss)))
110110

111+
(defsubst php-in-poly-php-html-mode ()
112+
"Return T if current buffer is in `poly-html-mode'."
113+
(and (boundp 'poly-php-html-mode)
114+
(symbol-value 'poly-php-html-mode)))
115+
111116
(defun php-create-regexp-for-method (visibility)
112117
"Make a regular expression for methods with the given VISIBILITY.
113118

0 commit comments

Comments
 (0)