How to disable php-indent warning in Emacs

When editing a PHP file with PHP code and HTML markup in Emacs, I continue to receive a warning:

Warning (php-indent):
        Indentation fails badly with mixed HTML and PHP.
        Look for an Emacs Lisp library that supports "multiple
        major modes" like mumamo, mmm-mode or multi-mode.

which appears at the bottom of my window and occupies half the editing screen. How to disable this?

I know that there are various "add-ons" and modes that you can add to make Emacs format PHP + HTML, but I just want to turn off the warning . How can i do this?

EDIT:

Here is the part of the file php-mode.elwhere the following error appears to be:

(defvar php-completion-table nil
  "Obarray of tag names defined in current tags table and functions know to PHP.")

(defvar php-warned-bad-indent nil)
(make-variable-buffer-local 'php-warned-bad-indent)

;; Do it but tell it is not good if html tags in buffer.
(defun php-check-html-for-indentation ()
  (let ((html-tag-re "</?\\sw+.*?>")
        (here (point)))
    (if (not (or (re-search-forward html-tag-re (line-end-position) t)
                 (re-search-backward html-tag-re (line-beginning-position) t)))
        t
      (goto-char here)
      (setq php-warned-bad-indent t)
      (lwarn 'php-indent :warning
             "\n\t%s\n\t%s\n\t%s\n"
             "Indentation fails badly with mixed HTML and PHP."
             "Look for an Emacs Lisp library that supports \"multiple"
             "major modes\" like mumamo, mmm-mode or multi-mode.")
      nil)))

(defun php-cautious-indent-region (start end &optional quiet)
  (if (or php-warned-bad-indent
          (php-check-html-for-indentation))
      (funcall 'c-indent-region start end quiet)))

(defun php-cautious-indent-line ()
  (if (or php-warned-bad-indent
          (php-check-html-for-indentation))
      (funcall 'c-indent-line)))
+4
source share
3 answers

Grepping Emacs, . , , .

- grep . , . , ..

, , (defadvice) , , , , , .

. , , , .

---

, , , lwarn. , , , warning-minimum-level , , warning-minimum-log-level, . .

, lwarn, php-check-html-for-indentation, . php-check-html-for-indentation, , , . , (, ), , php-check-html-for-indentation.

php-check-html-for-indentation , - , , - php-check-html-for-indentation, , lwarn. defadvice php-check-html-for-indentation , lwarn ad-do-it. . Elisp, Advising Functions Around Advice.

+2

, , . .emacs :

(setq php-mode-warn-if-mumamo-off nil)

: -)

+1

, ,

(setq php-warned-bad-indent t)

.emacs. .

( , , Lisp.)

0

All Articles