Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major-mode tcl-mode submode nxml-mode: xml indentation broken #79

Open
pointsman opened this issue Dec 16, 2017 · 4 comments
Open

Major-mode tcl-mode submode nxml-mode: xml indentation broken #79

pointsman opened this issue Dec 16, 2017 · 4 comments

Comments

@pointsman
Copy link

pointsman commented Dec 16, 2017

Create a buffer with the content

set xml {
<doc>
    <e1>
        <e2>
            <e3>text</e3>
        </e2>
    </e1>
</doc>
}  

and put it in tcl-mode. This lines are a syntactical correct (and by
no mean obscure) Tcl command.

Mark the region starting (including) at <doc> and ending (including)
</doc>. C-c % C-r, nxml-mode. Region is still active for me, if not
for you mark the same region and indent (TAB). I get

set xml {
    <doc>
<e1>
<e2>
<e3>text</e3>
</e2>
</e1>
</doc>
}  

I'd expect:

set xml {
<doc>
  <e1>
    <e2>
      <e3>text</e3>
    </e2>
  </e1>
</doc>
}  

This is with 25.2.1 and mmm-mode version 0.5.4 (without any own
mmm-customization, just installed with package.el and tried.

It is just a stripped down example. As far as I see for the
combination major-mode tcl-mode submode nxml-mode indentation in nxml
submode regions don't work. In the tcl-mode regions indentation works
as expected.

@pointsman pointsman changed the title Major-mode tcl-mode submode nxml-mode: xml indentation brocken Major-mode tcl-mode submode nxml-mode: xml indentation broken Dec 16, 2017
@dgutov
Copy link
Owner

dgutov commented Dec 16, 2017

I don't think nxml-mode is able to support this usage yet. You can try (EDIT:) sgml-mode, though.

@pointsman
Copy link
Author

pointsman commented Dec 16, 2017 via email

@dgutov
Copy link
Owner

dgutov commented Dec 16, 2017

C-h f xml-mode

Like I said in the edit, try sgml-mode.

May I ask what in nxml-mode is it that hinders it to be used as submode?

The full parser, probably. Haven't tried your experiment myself, though.

@pointsman
Copy link
Author

Yes, sgml-mode could be used for indentation of embedded xml.

nxml , though, is awful. Well, a working mmm mode is also. Thanks for exploring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants