emacs-devel
[Top][All Lists]
Advanced

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

Re: nXML mode maintenance and enhancement


From: N. Raghavendra
Subject: Re: nXML mode maintenance and enhancement
Date: Wed, 23 May 2018 20:18:11 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

At 2018-05-23T21:18:55+07:00, Yuri Khan wrote:

> 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.

> XML formats are used for text markup languages such as XHTML and DocBook;
> configuration files; and various data files. The indentation rules in
> ‘nxml-indent-line’ are very much oriented towards data files — as in, “add
> a level of indentation for every unclosed opening tag; remove a level of
> indentation for every closing tag opened elsewhere, independent of the
> actual tag names”. I am not well acquainted with PSGML, but I suspect that
> it is is more text-markup-oriented.

Yes, and PSGML provides a many more editing facilities for authors of
documents, than does nXML.

> I sort-of can do that now. This involves: hooking ‘rng-schema-change-hook’;
> in the hook function, looking at ‘rng-current-schema’ to see if its ‘caddr’
> is "html"; and, if so, pointing ‘indent-line-function’ at my own function
> 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.

>>     b) Support for processing instructions such as, e.g.,
>
>>        <?PSGML ELEMENT foo nofill=t>
>
>>        which specify that a `foo' element should not be disturbed when
>>        filling a region; this is useful if one wants to fill a buffer
>>        containing verbatim elements such as program listings.

Sure, one can have both the PI and variable customisation methods.  PIs
for editing have been a common facility in SGML and XML; for instance,
just today I saw that XMLMind has a PI mechanism for associating a RELAX
NG schema with a document.

Raghu.

--
N. Raghavendra <address@hidden>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/



reply via email to

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