3

If I go to scratch, M-x web-mode RET, type in this snippet:

<script type="text/x-dust-template">
    {#obj_to_iterate}
    {prop} <----- this should indent
    {/obj_to_iterate}
</script>

What am I doing wrong here? I see bugs with Dust.js have been solved and I can't be the only one doing simple stuff like this without noticing this indentation behaviour.

Also having problems with the general indentation of HTML, sometimes I get a TAB, sometimes I get two spaces, sometimes one space, who knows what else I can get but it is at least consistent so TAB or spaces are always the same for every line that I indent.

I just want one TAB per identation and properly indented Dust, can somebody help me?

1

I had a similar problem getting web-mode to play nice with Django templates. For me the fix was as simple as adding the following to my init file:

(setq web-mode-engines-alist
  '(("django"    . "\\.html\\'"))
  )

For you, try adding something like:

(setq web-mode-engines-alist
  '(("dust"    . "\\.html\\'"))
  )

For more details, see the section Associate an engine in the web-mode docs.

  • Works on my laptop at home, I have to check at work if this fixes stuff! – ani Aug 14 '16 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.