unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Mako template mode
@ 2010-06-29 21:19 Andrea Crotti
  2010-06-29 22:17 ` Deniz Dogan
  2010-06-29 23:15 ` Lennart Borgman
  0 siblings, 2 replies; 7+ messages in thread
From: Andrea Crotti @ 2010-06-29 21:19 UTC (permalink / raw)
  To: help-gnu-emacs

After some research I've found that the powerful nxhtml mode can support
it via MUMAMO.

All looks very nice, but configuring it like that

--8<---------------cut here---------------start------------->8---
  (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))
--8<---------------cut here---------------end--------------->8---

It doens't unfortunately work with this very not clear error..
Any idea?

I don't care so much about syntax highlighting, but I would like for
example to be able to define snippets (yasnippet) for mako for example
that work only in the files ".mak", which I have not clear yet how to do
without defining a derived mode for example.

--8<---------------cut here---------------start------------->8---
MU:mumamo-fontify-region: Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t
** In buffer new_person.mak
  backtrace()
  (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-fontify-region "%s" "Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t")
  (condition-case err (mumamo-fontify-region-1 start end verbose) (error (mumamo-display-error ... "%s" ...)))
  (if (not mumamo-use-condition-case) (let* (... ...) (mumamo-fontify-region-1 start end verbose)) (condition-case err (mumamo-fontify-region-1 start end verbose) (error ...)))
  (mumamo-condition-case err (mumamo-fontify-region-1 start end verbose) (error (mumamo-display-error ... "%s" ...)))
  (if (and mumamo-just-changed-major nil (= 0 ...)) (mumamo-display-error (quote mumamo-fontify-region) "Just changed major, should not happen") (mumamo-condition-case err (mumamo-fontify-region-1 start end verbose) (error ...)))
  mumamo-fontify-region(1 148 nil)
  font-lock-fontify-region(1 148)
  run-hook-with-args(font-lock-fontify-region 1 148)
  byte-code("\302\303\b	#\207" [start next run-hook-with-args jit-lock-functions] 4)
  jit-lock-fontify-now(1 501)
  jit-lock-function(1)
  (let ((ret ...)) (mumamo-msgfntfy "mumamo-jit-lock-function EXIT %s, ff=%s, just-changed=%s" start (when start ...) mumamo-just-changed-major) ret)
  mumamo-jit-lock-function(1)

mumamo-fontify-region: Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t
--8<---------------cut here---------------end--------------->8---

nxhtml looks a bit "aggressive" also with a lot of stuff implemented
inside it which is maybe also somewhere else, is that just my
impression?




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mako template mode
  2010-06-29 21:19 Mako template mode Andrea Crotti
@ 2010-06-29 22:17 ` Deniz Dogan
  2010-06-29 23:15 ` Lennart Borgman
  1 sibling, 0 replies; 7+ messages in thread
From: Deniz Dogan @ 2010-06-29 22:17 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

2010/6/29 Andrea Crotti <andrea.crotti.0@gmail.com>:
> After some research I've found that the powerful nxhtml mode can support
> it via MUMAMO.
>
> All looks very nice, but configuring it like that
>
> --8<---------------cut here---------------start------------->8---
>  (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))
> --8<---------------cut here---------------end--------------->8---
>
> It doens't unfortunately work with this very not clear error..
> Any idea?
>
> I don't care so much about syntax highlighting, but I would like for
> example to be able to define snippets (yasnippet) for mako for example
> that work only in the files ".mak", which I have not clear yet how to do
> without defining a derived mode for example.
>
> --8<---------------cut here---------------start------------->8---
> MU:mumamo-fontify-region: Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t
> ** In buffer new_person.mak
>  backtrace()
>  (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-fontify-region "%s" "Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t")
>  (condition-case err (mumamo-fontify-region-1 start end verbose) (error (mumamo-display-error ... "%s" ...)))
>  (if (not mumamo-use-condition-case) (let* (... ...) (mumamo-fontify-region-1 start end verbose)) (condition-case err (mumamo-fontify-region-1 start end verbose) (error ...)))
>  (mumamo-condition-case err (mumamo-fontify-region-1 start end verbose) (error (mumamo-display-error ... "%s" ...)))
>  (if (and mumamo-just-changed-major nil (= 0 ...)) (mumamo-display-error (quote mumamo-fontify-region) "Just changed major, should not happen") (mumamo-condition-case err (mumamo-fontify-region-1 start end verbose) (error ...)))
>  mumamo-fontify-region(1 148 nil)
>  font-lock-fontify-region(1 148)
>  run-hook-with-args(font-lock-fontify-region 1 148)
>  byte-code("\302\303   #\207" [start next run-hook-with-args jit-lock-functions] 4)
>  jit-lock-fontify-now(1 501)
>  jit-lock-function(1)
>  (let ((ret ...)) (mumamo-msgfntfy "mumamo-jit-lock-function EXIT %s, ff=%s, just-changed=%s" start (when start ...) mumamo-just-changed-major) ret)
>  mumamo-jit-lock-function(1)
>
> mumamo-fontify-region: Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t
> --8<---------------cut here---------------end--------------->8---
>
> nxhtml looks a bit "aggressive" also with a lot of stuff implemented
> inside it which is maybe also somewhere else, is that just my
> impression?
>
>
>

I get a bunch of these kinds of errors when using
mako-html-mumamo-mode as well. I never bothered trying to figure out
why though.

-- 
Deniz Dogan



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mako template mode
  2010-06-29 21:19 Mako template mode Andrea Crotti
  2010-06-29 22:17 ` Deniz Dogan
@ 2010-06-29 23:15 ` Lennart Borgman
  2010-06-29 23:17   ` Lennart Borgman
  2010-06-30  6:58   ` Andrea Crotti
  1 sibling, 2 replies; 7+ messages in thread
From: Lennart Borgman @ 2010-06-29 23:15 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

On Tue, Jun 29, 2010 at 11:19 PM, Andrea Crotti
<andrea.crotti.0@gmail.com> wrote:
> After some research I've found that the powerful nxhtml mode can support
> it via MUMAMO.
>
> All looks very nice, but configuring it like that
>
> --8<---------------cut here---------------start------------->8---
>  (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))


Oh, thanks. Seems like I forgot to add a file extension. I added
".mako", but not ".mak" since that is used by other programs.


> --8<---------------cut here---------------end--------------->8---
>
> It doens't unfortunately work with this very not clear error..
> Any idea?


Yes, add a bug report on Launchpad so we can investigate what is wrong:

  https://launchpad.net/nxhtml


> I don't care so much about syntax highlighting, but I would like for
> example to be able to define snippets (yasnippet) for mako for example
> that work only in the files ".mak", which I have not clear yet how to do
> without defining a derived mode for example.
>
> --8<---------------cut here---------------start------------->8---
> MU:mumamo-fontify-region: Assertion failed: (not (mumamo-fun-eq (mumamo-main-major-mode) this-maj)), t
> ** In buffer new_person.mak
>  backtrace()
...
> --8<---------------cut here---------------end--------------->8---
>
> nxhtml looks a bit "aggressive" also with a lot of stuff implemented
> inside it which is maybe also somewhere else, is that just my
> impression?


That must be wrong. It is very friendly, even kid-friendly too. ;-)

I placed some of the stuff on EmacsWiki first, but found that just led
to more bug reports because people where using old versions. To save
time I put everything in one package. (Some parts have been put on
EmacsWiki later by other people.)

In a few cases I have taken other peoples' package and put them in
nXhtml because they are used in nXhtml (or I want to avoid trouble
because there are several competing packages with different bugs). I
see no better way at the moment. I have suggested a dynamic package
handling that can ask you if you want to download a package, but there
has so far been no interest in such a package handler. (I have such a
package handler in nXhtml, so the code already exists, but some parts
must be changed a little bit for more generic use. Though that is
quite easy.)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mako template mode
  2010-06-29 23:15 ` Lennart Borgman
@ 2010-06-29 23:17   ` Lennart Borgman
  2010-06-30  6:58   ` Andrea Crotti
  1 sibling, 0 replies; 7+ messages in thread
From: Lennart Borgman @ 2010-06-29 23:17 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

On Wed, Jun 30, 2010 at 1:15 AM, Lennart Borgman
<lennart.borgman@gmail.com> wrote:
>
> Yes, add a bug report on Launchpad so we can investigate what is wrong:
>
>  https://launchpad.net/nxhtml


Maybe I should say too that i can not reproduce this problem so please
send a bug report.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mako template mode
  2010-06-29 23:15 ` Lennart Borgman
  2010-06-29 23:17   ` Lennart Borgman
@ 2010-06-30  6:58   ` Andrea Crotti
  2010-06-30  8:37     ` Lennart Borgman
  1 sibling, 1 reply; 7+ messages in thread
From: Andrea Crotti @ 2010-06-30  6:58 UTC (permalink / raw)
  To: help-gnu-emacs

Lennart Borgman <lennart.borgman@gmail.com> writes:
> Oh, thanks. Seems like I forgot to add a file extension. I added
> ".mako", but not ".mak" since that is used by other programs.
>

Well actually I don't know if ".mak" is also correct, but turbogears
looks for them so I used that extension...
>
>
> Yes, add a bug report on Launchpad so we can investigate what is wrong:
>
>   https://launchpad.net/nxhtml

I did https://bugs.launchpad.net/nxhtml/+bug/600092, if it's not clear
and complete enougg just tell me.
>
> That must be wrong. It is very friendly, even kid-friendly too. ;-)
>
> I placed some of the stuff on EmacsWiki first, but found that just led
> to more bug reports because people where using old versions. To save
> time I put everything in one package. (Some parts have been put on
> EmacsWiki later by other people.)
>
> In a few cases I have taken other peoples' package and put them in
> nXhtml because they are used in nXhtml (or I want to avoid trouble
> because there are several competing packages with different bugs). I
> see no better way at the moment. I have suggested a dynamic package
> handling that can ask you if you want to download a package, but there
> has so far been no interest in such a package handler. (I have such a
> package handler in nXhtml, so the code already exists, but some parts
> must be changed a little bit for more generic use. Though that is
> quite easy.)

Well I just meant that for example
- autoloading it already displays the menu (even if maybe I don't need it)
- the syntax highlighting is really too much, at least in mako-html-mumamo
  I get everything highlighted blue in background any other fancy
  highlighting and colors in the mako stuff...

For the rest is really great, those are the only problems I've seen now...




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mako template mode
  2010-06-30  6:58   ` Andrea Crotti
@ 2010-06-30  8:37     ` Lennart Borgman
  2010-06-30  9:48       ` Andrea Crotti
  0 siblings, 1 reply; 7+ messages in thread
From: Lennart Borgman @ 2010-06-30  8:37 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

On Wed, Jun 30, 2010 at 8:58 AM, Andrea Crotti
<andrea.crotti.0@gmail.com> wrote:
>
> I did https://bugs.launchpad.net/nxhtml/+bug/600092, if it's not clear
> and complete enougg just tell me.

Thanks. I will respond there. The bug tracker will mail you when I respond.

> - autoloading it already displays the menu (even if maybe I don't need it)

Default is set to be useful for especially beginners. Just turn off
nxhtml-menu-mode if you don't want the menu.

> - the syntax highlighting is really too much, at least in mako-html-mumamo
>  I get everything highlighted blue in background any other fancy
>  highlighting and colors in the mako stuff...

See https://answers.launchpad.net/nxhtml/+faq/1080



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mako template mode
  2010-06-30  8:37     ` Lennart Borgman
@ 2010-06-30  9:48       ` Andrea Crotti
  0 siblings, 0 replies; 7+ messages in thread
From: Andrea Crotti @ 2010-06-30  9:48 UTC (permalink / raw)
  To: help-gnu-emacs

Lennart Borgman <lennart.borgman@gmail.com> writes:

> Thanks. I will respond there. The bug tracker will mail you when I
> respond.

Ok I've added another comment.

> Default is set to be useful for especially beginners. Just turn off
> nxhtml-menu-mode if you don't want the menu.

Ah cool, someone that cares about beginners in Emacs, I thought they
didn't exist :D

> See https://answers.launchpad.net/nxhtml/+faq/1080
Good thanks, but I have to say that it is not so clear:

--8<---------------cut here---------------start------------->8---
Color chunks with depth greater than or equal to this. Hide Rest   
When 0 all chunks will be colored.  If 1 all sub mode chunks will
be colored, etc.
--8<---------------cut here---------------end--------------->8---

I tried to set to 1 but now I can't see the difference given that I get
too many errors, but what should that mean?

1 colors only the last html chunks in things like:
html -> mako -> html (if something like this would be possible)

1 level of nesting is not enough?




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-06-30  9:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-29 21:19 Mako template mode Andrea Crotti
2010-06-29 22:17 ` Deniz Dogan
2010-06-29 23:15 ` Lennart Borgman
2010-06-29 23:17   ` Lennart Borgman
2010-06-30  6:58   ` Andrea Crotti
2010-06-30  8:37     ` Lennart Borgman
2010-06-30  9:48       ` Andrea Crotti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).