Using mumamo-html-mako as major mode in auto-mode-alist doesn't work in 2.08

Bug #600092 reported by Andrea Crotti on 2010-06-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Using emacs version
GNU Emacs 23.2.1 (x86_64-apple-darwin10.3.0, NS apple-appkit-1038.29) of 2010-05-09 on linc

I wanted to use mumamo-html-mako automatically for mako files, so I added

  (load (concat conf "nxhtml/autostart.el"))
  (add-to-list 'auto-mode-alist '("\\.mak$" . mako-html-mumamo))
  (add-to-list 'auto-mode-alist '("\\.mako$" . mako-html-mumamo))

To my configuration, the file if empty gets open correctly, but when I start to work with it I get many error like

Parsing error.mak...done
MU:mumamo-set-major-pre-command: cb:error.mak, Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t
** In buffer error.mak
  (let ((standard-output standard-output)) (backtrace))
  (progn (let (...) (backtrace)) (with-current-buffer standard-output (buffer-string)))
  (unwind-protect (progn (let ... ...) (with-current-buffer standard-output ...)) (kill-buffer standard-output))
  (let ((standard-output ...)) (unwind-protect (progn ... ...) (kill-buffer standard-output)))
  (with-output-to-string (backtrace))
  (let ((format-string2 ...) (bt ...)) (mumamo-message-with-face (concat ... "
" ... bt) (quote highlight)) (apply (quote message) format-string2 lwarn-type args) (run-with-idle-timer 1 nil (quote mumamo-show-report-message)) (when mumamo-display-error-stop (setq font-lock-mode nil) (when ... ...) (when ... ...) (apply ... format-string2 lwarn-type args)))
  mumamo-display-error(mumamo-set-major-pre-command "cb:%s, %s" #<buffer error.mak> "Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t")
  (condition-case err (if (memq this-command mumamo-safe-commands-in-wrong-major) (mumamo-request-idle-set-major-mode) (let* ... ...)) (error (mumamo-display-error ... "cb:%s, %s" ... ...)))
  (if (not mumamo-use-condition-case) (let* (... ...) (if ... ... ...)) (condition-case err (if ... ... ...) (error ...)))
  (mumamo-condition-case err (if (memq this-command mumamo-safe-commands-in-wrong-major) (mumamo-request-idle-set-major-mode) (let* ... ...)) (error (mumamo-display-error ... "cb:%s, %s" ... ...)))

lborgman (lennart-borgman) wrote :

Hi Andrea, thanks for the bug report.

I need more information since as I said I can't reproduce this. Could you please tell me more exactly what you do?

Start from an Emacs with only nXhtml loaded. You can start such an Emacs from within Emacs with

  M-x emacs-Q-nxhtml

Changed in nxhtml:
importance: Undecided → Medium
status: New → Incomplete
Andrea Crotti (andrea-crotti-0) wrote :

This is what I've done now:
emacs -Q
M-x load-file nxhtml/autostart.el
C-x C-f ...file.mak
M-x mako-html-mumamo-mode

And I get the same error as printed above...

Andrea Crotti (andrea-crotti-0) wrote :

Tried also with
and on linux (but always version 23.2) but same error
then or is something wrong in what I do or there's a problem with 23.2.

lborgman (lennart-borgman) wrote :

Thanks. That does not happen to me so there is something different.

What version of Emacs are you using?

Could you please try with the current beta (either check it out from the repository or get it here:

Changed in nxhtml:
status: Incomplete → In Progress
Andrea Crotti (andrea-crotti-0) wrote :

Sorry I forgot to write the version

GNU Emacs 23.2.1 (x86_64-apple-darwin10.3.0, NS apple-appkit-1038.29) of 2010-05-09 on linc

And I'm on OSX 10.6

I also tried the beta and it has the same problem.
Also on arch linux (64 bit) with GNU Emacs 23.2.1 I get the same error

lborgman (lennart-borgman) wrote :

Thanks Andrea, I have tried Emacs 23.2.1 on w32, but I still can not reproduce the error.

Could you please try with the latest nXhtml beta (see above)?

Andrea Crotti (andrea-crotti-0) wrote :

Yes well I also already tried with the beta but I get exactly the same error.

Then it must be a problem with Macosx/Linux, and reading the newgroup other people have it...

If you can get some informations from the log I've pasted and maybe tell me what to try next I can have another look...

lborgman (lennart-borgman) wrote :

I actually think it is a bug in nXhtml, but I need a more precise recipe (or I have missed something).

Could you please try to find a recipe starting from "M-x emacs-Q-nxhtml"? Tell me exactly what you do after that.

Andrea Crotti (andrea-crotti-0) wrote :

So yes I did
M-x emacs-Q-nxhtml
and in the new emacs simply

C-x C-f test.mak
M-x mako-html-mumamo-mode
And then I started to type something, when I arrived at the second line:

<%def func="name">

It started to go crazy and it becomes unusable (also selection doesn't work) until I change mode.

But the error is always the same as seen above.
And the same thing happens if I paste a perfectly correct mako file inside my buffer after passing to mako-html-mumamo-mode

lborgman (lennart-borgman) wrote :

Thanks Andrea, finally I can reproduce it.

It is a bit funny, this part is totally broken in the current beta, but still I was not able to reproduce it without your latest recipe. ;-)

Bug reports are really necessary. There are too many multi major modes in nXhtml for me to test. I will look into this. Maybe it is easy to fix, I do not know yet. I have put some borders on the wrong side so to say, but there are many different cases so I have to think a little bit about what to do.

Thanks to you for the great work,
while is not fixed I'll use normal html-mode then...

lborgman (lennart-borgman) wrote :

Hi Andrea, could you please test again with the new beta 2.09 of nXhtml I just uploaded?

I am pretty sure there are more indentation bugs, but I need some help catching them.

Changed in nxhtml:
status: In Progress → Fix Committed

So I used bazaar to take the last revision, then
cp -Rv nxhtml my/conf/path

and then again
M-x emacs-Q-nxhtml
if there was something already in nxhtml and I overwrote it when I call emacs-Q-nxhtml it will load the new one right?

Anyway still the same error, now when I start to write the for loop
<%def func="name(args)">
% for x in

I also see this in the log
Tested for Bug 3467 => FAILED

which maybe is also not nice...


lborgman (lennart-borgman) wrote :

Hi Andreas,

Thanks, I can't reproduce the problem. Maybe I need a more precise recipe or something is different between our installation.

Maybe you have old *.elc files. Emacs will load the old *.elc files so please remove them if you have and try again.

I do not think bug 3467 is involved here:

    "Tested for Bug 3467 => FAILED"

This is an Emacs bug ( that I have tried to work around. It was finally fixed in the current source code in May but not in the latest released Emacs. However since the problem is a hard one and the work around perhaps does not work always I have left this message there.

lborgman (lennart-borgman) wrote :

Please wait, I found another problem there. I will look into it and upload a fix later today.

lborgman (lennart-borgman) wrote :

Please test again, Andrea. (Oh, I called you Andreas above, sorry.)

Great, looks like it's working!
But I'm wondering what's the difference, since I think I tried the 718 already before and it's the last one available for the repo...

Anyway from my experiments I don't see anymore errors, thanks a lot!

lborgman (lennart-borgman) wrote :

Great that it is working, but unfortunately you did not get the version with the latest changes... - you only got 718 which I uploaded 18 hours ago. (Though the bug you were looking at was probably fixed there).

Something went wrong with my upload. Someday I will learn to look at the error messages when uploading.

Revision 719 should be the latest now. Please get update again.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers