[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nXML mode maintenance and enhancement

From: Yuri Khan
Subject: Re: nXML mode maintenance and enhancement
Date: Wed, 23 May 2018 22:15:05 +0700

On Wed, May 23, 2018 at 10:03 PM N. Raghavendra <address@hidden>

> > There is not and cannot be One True Way to indent XML, for all users and
> > uses of nXML.

> Sure, the user can always change it.  Every mode comes with a default
> indentation style.  I am only suggesting that the default indentation
> rules of nXML conform to those of the SGML and PSGML modes.

And I’m suggesting that text markup languages constitute a small portion of
all XML-based formats, and thus the default rules might be good enough for
the majority of the formats.

> > [Customizing indentation] involves: hooking ‘rng-schema-change-hook’;
> > in the hook function, looking at ‘rng-current-schema’ to see if its
> > is "html"; and, if so, pointing ‘indent-line-function’ at my own
> > that pretty much has to reimplement the whole of ‘nxml-indent-line’ from
> > scratch, in about 250 lines of Elisp.

> I wonder if you can share your code here; perhaps I or someone else can
> try to adapt it into a general function in nXML.

Why not. Warning, personal-use-quality code ahead.

Magic words, for all code in the attached file that is not copied from nxml:

I dedicate any and all copyright interest in this software to the
public domain. I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors. I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.

Attachment: yk-xhtml-indent.el
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]