Just after opening a file containing just PHP, I tried to indent and received the following error. Is there a conflict with yasnippet?
I would also like to use company-mode and flymake-mode with PHP files. Do you know if I'm going to run into this same kind of issue?
Debugger entered--Lisp error: (error "indent-line-in-mirror error at pos 1943, php-mode, lines not eq after indentation")
signal(error ("indent-line-in-mirror error at pos 1943, php-mode, lines not eq after indentation"))
error("indent-line-in-mirror error at pos %d, %s, lines not eq after indentation" 1943 php-mode)
apply(error "indent-line-in-mirror error at pos %d, %s, lines not eq after indentation" (1943 php-mode))
msgerr("indent-line-in-mirror error at pos %d, %s, lines not eq after indentation" 1943 php-mode)
(if (or (with-current-buffer for-buffer ...)) nil (msgerr "indent-line-in-mirror error at pos %d, %s, lines not eq after indentation" line-end major))
(unless (or (with-current-buffer for-buffer ...)) (msgerr "indent-line-in-mirror error at pos %d, %s, lines not eq after indentation" line-end major))
(if (string= line-in-src line-in-mirror) nil (unless (or ...) (msgerr "indent-line-in-mirror error at pos %d, %s, lines not eq after indentation" line-end major)))
(unless (string= line-in-src line-in-mirror) (unless (or ...) (msgerr "indent-line-in-mirror error at pos %d, %s, lines not eq after indentation" line-end major)))
(let* ((major ...) (for-buffer ...) (mirror-buf ...) new-ind line-in-mirror line-in-mirror-is-blank line-in-src) (msgtrc "indent-in-mirror [%s]: %S line-end=%s" major chunk line-end) (with-current-buffer mirror-buf (goto-char line-beg) (funcall indent-line-function) (back-to-indentation) (setq new-ind ...) (setq line-in-mirror-is-blank ...) (setq line-in-mirror ...)) (with-current-buffer for-buffer (save-restriction ... ... ... ... ... ...)) (unless (string= line-in-src line-in-mirror) (unless ... ...)))
mumamo-indent-line-in-mirror(#<overlay from 1 to 105347 in EventTemplateController.php> 1943 1943)
(save-restriction (widen) (mumamo-indent-line-in-mirror chunk (point-at-bol) (point-at-eol)))
mumamo-call-indent-line(#<overlay from 1 to 105347 in EventTemplateController.php>)
(progn (activate-change-group --change-group-handle--) (mumamo-call-indent-line (nth 0 this-line-chunks)) (when (= 0 ...) (setq ind-zero t) (goto-char ...) (widen) (setq ind-on-first-sub-line ...) (goto-char here) (signal ... nil)) (setq --change-group-success-- t))
(unwind-protect (progn (activate-change-group --change-group-handle--) (mumamo-call-indent-line ...) (when ... ... ... ... ... ... ...) (setq --change-group-success-- t)) (if --change-group-success-- (accept-change-group --change-group-handle--) (cancel-change-group --change-group-handle--)))
(let ((--change-group-handle-- ...) (undo-outer-limit nil) (undo-limit most-positive-fixnum) (undo-strong-limit most-positive-fixnum) (--change-group-success-- nil)) (unwind-protect (progn ... ... ... ...) (if --change-group-success-- ... ...)))
(atomic-change-group (mumamo-call-indent-line (nth 0 this-line-chunks)) (when (= 0 ...) (setq ind-zero t) (goto-char ...) (widen) (setq ind-on-first-sub-line ...) (goto-char here) (signal ... nil)))
(condition-case nil (atomic-change-group (mumamo-call-indent-line ...) (when ... ... ... ... ... ... ...)) (mumamo-error-ind-0))
(save-restriction (mumamo-update-obscure chunk here) (let (...) (narrow-to-region ... ...)) (condition-case nil (atomic-change-group ... ...) (mumamo-error-ind-0)) (when ind-zero (setq want-indent-major ...) (save-excursion ... ...)))
(let ((chunk ...) (font-lock-dont-widen t) ind-zero (here ...) ind-on-first-sub-line) (save-restriction (mumamo-update-obscure chunk here) (let ... ...) (condition-case nil ... ...) (when ind-zero ... ...)))
(if (mumamo-fun-eq this-line-major1 main-major) (let (... ...) (mumamo-msgindent " In main major mode") (forward-line 0) (skip-chars-backward " \n
\f") (forward-line 0) (if ... ... ... ...) (mumamo-msgindent " In main major mode B") (setq last-parent-major-indent ...)) (mumamo-msgindent " In sub major mode") (let (... ... ind-zero ... ind-on-first-sub-line) (save-restriction ... ... ... ...)))
(cond (template-indent-abs (setq want-indent ...)) (leaving-submode (mumamo-msgindent " leaving last-parent-major-indent=%s" last-parent-major-indent) (if ... ... ... ...)) (entering-submode (setq this-line-indent-major ...) (mumamo-msgindent " this-line-indent-major=%s, major-mode=%s this0=%s" this-line-indent-major major-mode this-line-major0) (mumamo-msgindent " mumamo-submode-indent-offset=%s" mumamo-submode-indent-offset) (unless ... ...) (setq want-indent ...) (unless ... ...) (when ... ...) (if want-indent ... ...) (mumamo-msgindent " enter sub.want-indent=%s, curr=%s, last-main=%s" want-indent ... last-parent-major-indent)) (t (setq this-line-indent-major ...) (mumamo-msgindent " this-line-indent-major=%s" this-line-indent-major) (unless ... ...) (if ... ... ... ...)))
(let* ((start-point ...) (prev-line-chunk0 ...) (prev-line-chunk2 ...) (prev-line-chunk3 ...) (prev-line-major0 ...) (prev-line-major1 ...) (prev-line-major2 ...) (prev-line-major3 ...) (prev-depth0 ...) (prev-depth2 ...) (prev-depth3 ...) (this-line-chunks ...) (this-line-chunk0 ...) (this-line-chunk2 ...) (this-line-chunk3 ...) (this-line-major0 ...) (this-line-major1 ...) (this-line-major2 ...) (this-line-major3 ...) (this-depth0 ...) (this-depth2 ...) (this-depth3 ...) this-line-indent-major major-indent-line-function (main-major ...) (old-indent ...) (next-entering-submode ...) (entering-submode ...) (leaving-submode ...) want-indent want-indent-major got-indent (here-on-line ...) this-pending-undo-list (n1-while 0) (n2-while 0) (n3-while 0) (this-line-indentor-chunk ...) (this-line-indentor-prev ...) (this-line-is-indentor ...) (this-template-shift ...) (prev-template-indentor ...) (prev-template-shift-rec ...) (template-shift ...) (template-indent-abs ...)) (when template-shift (unless template-indent-abs)) (when (and leaving-submode entering-submode) (message "Do not know how to indent here (both leaving and entering sub chunks)")) (when (or leaving-submode entering-submode) (unless last-parent-major-indent ...)) (mumamo-msgindent " leaving-submode=%s, entering-submode=%s" leaving-submode entering-submode) (cond (template-indent-abs ...) (leaving-submode ... ...) (entering-submode ... ... ... ... ... ... ... ... ...) (t ... ... ... ...)) (when want-indent (indent-line-to want-indent) (when want-indent-major ...)) (goto-char here-on-line) (list this-line-chunks last-parent-major-indent next-entering-submode))
mumamo-indent-line-function-1(nil nil nil)
(let ((here ...) fontification-functions rng-nxml-auto-validate-flag (before-text ...)) (mumamo-indent-line-function-1 nil nil nil) (if before-text (back-to-indentation) (goto-char here)))
mumamo-indent-line-function()
indent-for-tab-command(nil)
call-interactively(indent-for-tab-command)
(progn (setq this-command command) (call-interactively command))
(if (and (commandp command) (not ...)) (progn (setq this-command command) (call-interactively command)))
(when (and (commandp command) (not ...)) (setq this-command command) (call-interactively command))
(let* ((yas/minor-mode nil) (yas/direct-keymaps nil) (keys-1 ...) (keys-2 ...) (command-1 ...) (command-2 ...) (command ...)) (when (and ... ...) (setq this-command command) (call-interactively command)))
(cond ((eq yas/fallback-behavior ...) nil) ((eq yas/fallback-behavior ...) (let* ... ...)) ((and ... ... ...) (if ... ... ...)) (t nil))
yas/fallback(trigger-key)
(if (and templates-and-pos (first templates-and-pos)) (yas/expand-or-prompt-for-template (first templates-and-pos) (second templates-and-pos) (third templates-and-pos)) (yas/fallback (quote trigger-key)))
(let (templates-and-pos) (unless (and yas/expand-only-for-last-commands ...) (setq templates-and-pos ...)) (if (and templates-and-pos ...) (yas/expand-or-prompt-for-template ... ... ...) (yas/fallback ...)))
yas/expand()
call-interactively(yas/expand nil nil)
Thanks,
Chris.
Hi Chris, thanks for the bug report.
I see you are using a recent checkout, because the error is from the new indentation code. That is not quite ready yet and I expect some bugs.
Could you please tell me more exactly what you are doing, including a small example? This error might have something to do with using templates, but I am not sure (have not thought of it yet).
flymake-mode should work just as before, it is only indentation that is a bit more shaky now.
I am not sure about company-mode at the moment. I do not remember because I gave up myself on using since it had some problems for my use cases. (I have taken that up on the Emacs developers list. We need a new way of handling menus like those company-mode uses.) However for php files I think the only problem would be that minor mode variables used by company-mode might get killed because they are not properly protected when changing major mode. If you see such problems then please send a bug report here.