help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: p tags and indenting in Html Mode


From: Richard Riley
Subject: Re: p tags and indenting in Html Mode
Date: Wed, 02 Sep 2009 00:52:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Tyler Smith <tyler.smith@eku.edu> writes:

> Richard Riley wrote:
>> pjb@informatimago.com (Pascal J. Bourguignon) writes:
>>   
>>> Tyler Smith <tyler.smith@eku.edu> writes:
>>>     
>>>> Html mode recognizes that <p> tags don't need to be closed, so
>>>> successive tags get indented to the same level. But when an unclosed
>>>> <p> tag is followed by a heading (e.g., <h3>), the heading gets
>>>> indented as if it were within the previous <p>, as do all subsequent
>>>> tags that aren't <p> tags. In other words, the heading is indented
>>>> further than the <p> tags that were there before. How can I get html
>>>> mode to keep the indentation at the same level? I put a small example
>>>> below to clarify.
>>>>
>>>>       
>>> Close your tags!  So your html becomes more compatible with xhtml.
>>>     
>>
>> A lot of web designers don't go anyway near xhtml because it's a pain
>> and doesn't work properly anywhere other than in theory :-; A google for
>> "xhtml not working" tells you why.
>>
>> Having said that closing tags is a better idea.
>>   
>
> I don't really care one way or the other about xhtml. I tried closing my 
> tags by turning on sgml-xml-mode. This makes html mode insert a closing 
> </p> tag, which solves my original problem. But it also expects closing 
> tags for other html tags that don't normally use them: link, base, img 
> etc. So in sgml-xml-mode, indentation is screwed up following all of 
> those tags. I can of course manually close my <p> tags, or use C-c /, 
> but there should be a better way. Can I make html-mode close p tags 
> without turning on sgml-xml-mode? I have tried poking around with the 
> tag skeletons, but I find the documentation a little challenging.
>
> As an off-topic aside, is xhtml still moving forward? I thought the W3C 
> had recently decided to ditch it in favor of html 5? Anything I've read 
> suggests that there's no compelling reason to use xhtml for
> webdesign. 

I tried it and regretted a LOT of wasted time and effort. It talked a
good talk but failed the walk. I was somewhat surprised by some replies
there that seemed to suggest xhtml was the working, accepted
standard. It's most certainly not and a LOT of programmers have dropped
it. So I'm with you on that one.

> If that's the case, I'd rather get html-mode configured to support 
> regular html. I'm not really invested in either option, I just want 
> consistent indentation that doesn't require manually tweaking my tags.

I use nxhtml generally, but there are issues I intend to report back to
Lennart. Its pretty slow and there are some nasty indentation issues with
certain mixed files (php and x/html). Having said that I do close tags.

I'm still not sure of the best way to use emacs for this kind of
programming, but nxhtml seems the best of the bunch for me.





reply via email to

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