unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Possible bugs with indentation in html mode
@ 2007-02-16 23:31 Angela Bellavance
  0 siblings, 0 replies; 6+ messages in thread
From: Angela Bellavance @ 2007-02-16 23:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I'm editing HTML code using emacs and I'm noticing 
some strange behavior with the indentation.
I can hit TAB on elements like "<table>" and "<tr>" 
and "<td>", and emacs will happily indent each by 
two spaces relative to the container tag, ending the 
additional space when it finds the corresponding 
closing tag. However, it does not handle single tags 
well (e.g. "<br>", "<meta...>", etc.). Emacs adds 
the two-space indentation following one of these 
single tags and will not decrement the indentation 
unless a closing tag is found for some surrounding 
set of tags.

Is there any chance of fixing this behavior?

I had one other question as well. Is there any way 
to make the indentation behavior follow the 
"relative to previous line" rule?  Personally, I 
don't always want the addition of two spaces of 
indentation added every time I open a tag set. For 
example, I would prefer something like this:

<html>
<head>
<title>
   <font color="black">This is my title</font>
</title>
</head>
<body>
<h1>This is my title</h1>
<br>
<table>
   <tr>
     <td>Cell 1</td>
     <td>Cell 2</td>
   </tr>
</table>
</body>
</html>

But if I TAB-indent the above HTML using Emacs, I 
get this:

<html>
   <head>
     <title>
       <font color="black">This is my title</font>
     </title>
   </head>
   <body>
     <h1>This is my title</h1>
     <br>
     <table>
       <tr>
         <td>Cell 1</td>
         <td>Cell 2</td>
       </tr>
     </table>
     </body>
</html>

When I've got nested tables with large cell 
contents, having every line indented those extra 
several spaces can really be a pain....

Thanks for any help or suggestions!

- Angela

-- 
Dr. Angela Bellavance
Fermilab Computing Division
Running Experiments Operations
630-840-2284
bellavan@fnal.gov

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-02-17 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4635.1171668686.2155.help-gnu-emacs@gnu.org>
2007-02-17  4:41 ` Possible bugs with indentation in html mode Stefan Monnier
2007-02-17  5:57   ` Angela Bellavance
2007-02-17  6:37     ` Matthew Flaschen
2007-02-17 16:55     ` Stefan Monnier
     [not found]     ` <mailman.4641.1171694271.2155.help-gnu-emacs@gnu.org>
2007-02-17 16:58       ` RealityMonster
2007-02-16 23:31 Angela Bellavance

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).