Re: Excessively indented attributes

Lennart Staflin <[email protected]>
Newsgroups gmane.emacs.psgml.user
Message-ID <[email protected]>
On lördag, juni 22, 2002, at 07:30 , David Cramer wrote:
> Using psgml 1.2.1-13, emacs 20.7.1 on redhat 7.2.
> sgml-indent-step 2
> sgml-indent-data t
>
>> PSGML breaks the attribute at the first space and moves it down a
> line;
>> it also fails to format the rest of that element:
>>
>>  <para>
>>    Before you begin, open the <filename
>>
> class="directory">foodir</filename>
>> in a file browser...
>>  </para>
>>
>
> On my windows (psgml 1.2.4/emacs 21.1.1) installation I would see
> something like:
>
>>    Before you begin, open the <filename
>>      class="directory">foodir</filename>
>
> Is there a separate setting for the indentation of attributes? I haven't
> found anything that looks promising or different between the
> configuration of the two environments.
>

The difference is the PSGML version. It has been "fixed" in the latest 
version.

I started to rewrite the code for indentation to make it more flexible. 
There are now two (undocumented) variables to choose the strategy for 
indentation:

- sgml-content-indent-function
- sgml-attribute-indent-function

The variable value should be a function that takes an element object and 
returns the indentation to use. There are three functions included: 
sgml-indent-according-to-level, sgml-indent-according-to-stag, 
sgml-indent-according-to-stag-end.

I haven't made this "official" because there is some problems with the 
design. Attributes are usually indented with the 
sgml-attribute-indent-function, but not if the element is in mixed 
content (as in the example above) then it is indented as content. I 
think these two cases need to be separated, but perhaps there should be 
another variable instead of indenting the attributes as content. Another 
problem is that end-tags are indented as content, they should perhaps 
also be given their own variable.

//Lennart



-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.