Which major mode in emacs?

View: New views
2 Messages — Rating Filter:   Alert me  

Which major mode in emacs?

by Sam Varshavchik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to find an emacs major mode implementation for editing Docbook
documents which handles autoindentation the way I like it. I don't think
that my preferences are unusual, but rather straightforward: Tab, or "M-x
indent-region" should autoindent text in contexts where whitespace does not
matter, and leave it alone in <literallayout> or <programlisting>, where
whitespace matters. This means that the major mode needs to be DTD aware.

I tried nxml first. nxml looks nice, but it indents everything. After I
reindent a large block of text, I always have to go back and undo all the
added whitespace in every <programlisting>.

Then, I installed psgml. psgml seems to indent XML tags only, and does not
autoindent any text. Within <para>, whitespace does not matter, but psgml
leaves it alone.

Any other suggestions?




attachment0 (204 bytes) Download Attachment

Which major mode in emacs?

by Neil Roeth-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

FWIW, if you set sgml-indent-data to a non-nil value, PSGML will indent text.
I don't know of a way not to indent <literallayout> or <programlisting>
content, though.

On Aug 22, Sam Varshavchik (mrsam@...) wrote:
 > I'm trying to find an emacs major mode implementation for editing Docbook
 > documents which handles autoindentation the way I like it. I don't think
 > that my preferences are unusual, but rather straightforward: Tab, or "M-x
 > indent-region" should autoindent text in contexts where whitespace does not
 > matter, and leave it alone in <literallayout> or <programlisting>, where
 > whitespace matters. This means that the major mode needs to be DTD aware.
 >
 > I tried nxml first. nxml looks nice, but it indents everything. After I
 > reindent a large block of text, I always have to go back and undo all the
 > added whitespace in every <programlisting>.
 >
 > Then, I installed psgml. psgml seems to indent XML tags only, and does not
 > autoindent any text. Within <para>, whitespace does not matter, but psgml
 > leaves it alone.
 >
 > Any other suggestions?
 >
 >

--
Neil Roeth

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...