all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Indentation for html-mode
@ 2008-04-13 11:23 Jens Teich
  2008-04-13 12:38 ` Lennart Borgman (gmail)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jens Teich @ 2008-04-13 11:23 UTC (permalink / raw)
  To: help-gnu-emacs

Example from Edi Weitz' Lisp package HTML-Template
(http://weitz.de/html-template/):

<table border=1>
  <!-- TMPL_LOOP rows -->
    <tr>
      <!-- TMPL_LOOP cols -->
        <!-- TMPL_IF colorful-style -->
          <td align="right" bgcolor="pink"><!-- TMPL_VAR content --></td>
        <!-- TMPL_ELSE -->
          <td align="right" ><!-- TMPL_VAR content --></td>
        <!-- /TMPL_IF -->
      <!-- /TMPL_LOOP -->
    </tr>
  <!-- /TMPL_LOOP -->
</table>

is indented in html-mode

<html>
  <table border=1>
    <!-- TMPL_LOOP rows -->
    <tr>
      <!-- TMPL_LOOP cols -->
      <!-- TMPL_IF colorful-style -->
      <td align="right" bgcolor="lime"><!-- TMPL_VAR content --></td>
      <!-- TMPL_ELSE -->
      <td align="right" ><!-- TMPL_VAR content --></td>
      <!-- /TMPL_IF -->
      <!-- /TMPL_LOOP -->
    </tr>
    <!-- /TMPL_LOOP -->
  </table>
</html>

because the comment-like tags "<!-- TMPL ..." are unknown. How do I
teach html-mode to recognize their special meaning?

Jens


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

* Re: Indentation for html-mode
  2008-04-13 11:23 Indentation for html-mode Jens Teich
@ 2008-04-13 12:38 ` Lennart Borgman (gmail)
       [not found] ` <mailman.10322.1208090292.18990.help-gnu-emacs@gnu.org>
  2008-04-13 18:54 ` Chris McMahan
  2 siblings, 0 replies; 6+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-13 12:38 UTC (permalink / raw)
  To: Jens Teich; +Cc: help-gnu-emacs

Jens Teich wrote:
> Example from Edi Weitz' Lisp package HTML-Template
> (http://weitz.de/html-template/):
> 
> <table border=1>
>   <!-- TMPL_LOOP rows -->
>     <tr>
>       <!-- TMPL_LOOP cols -->
>         <!-- TMPL_IF colorful-style -->
>           <td align="right" bgcolor="pink"><!-- TMPL_VAR content --></td>
>         <!-- TMPL_ELSE -->
>           <td align="right" ><!-- TMPL_VAR content --></td>
>         <!-- /TMPL_IF -->
>       <!-- /TMPL_LOOP -->
>     </tr>
>   <!-- /TMPL_LOOP -->
> </table>
> 
> is indented in html-mode
> 
> <html>
>   <table border=1>
>     <!-- TMPL_LOOP rows -->
>     <tr>
>       <!-- TMPL_LOOP cols -->
>       <!-- TMPL_IF colorful-style -->
>       <td align="right" bgcolor="lime"><!-- TMPL_VAR content --></td>
>       <!-- TMPL_ELSE -->
>       <td align="right" ><!-- TMPL_VAR content --></td>
>       <!-- /TMPL_IF -->
>       <!-- /TMPL_LOOP -->
>     </tr>
>     <!-- /TMPL_LOOP -->
>   </table>
> </html>
> 
> because the comment-like tags "<!-- TMPL ..." are unknown. How do I
> teach html-mode to recognize their special meaning?

It looks like a job for the template library. Doesn't it provide indenting?




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

* Re: Indentation for html-mode
       [not found] ` <mailman.10322.1208090292.18990.help-gnu-emacs@gnu.org>
@ 2008-04-13 17:32   ` Jens Teich
  2008-04-13 20:44     ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Teich @ 2008-04-13 17:32 UTC (permalink / raw)
  To: help-gnu-emacs

> It looks like a job for the template library. Doesn't it provide indenting?

Do you mean http://emacs-template.sourceforge.net/?

I can't find anything about indentation there.

Jens


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

* Re: Indentation for html-mode
  2008-04-13 11:23 Indentation for html-mode Jens Teich
  2008-04-13 12:38 ` Lennart Borgman (gmail)
       [not found] ` <mailman.10322.1208090292.18990.help-gnu-emacs@gnu.org>
@ 2008-04-13 18:54 ` Chris McMahan
  2008-04-13 20:32   ` Jens Teich
  2 siblings, 1 reply; 6+ messages in thread
From: Chris McMahan @ 2008-04-13 18:54 UTC (permalink / raw)
  To: help-gnu-emacs


I think the current mode is behaving correctly. The indentation is to
reflect which elements are parents and children in this case.
Indenting the <tr> tag after the comments would imply to me that the
<tr> is a child of the comment, which in turn is a child of the
<table> tag.

Are you sure you want the comments indented like you described?

- Chris


Jens Teich <spamtrap@jensteich.de> writes:

> Example from Edi Weitz' Lisp package HTML-Template
> (http://weitz.de/html-template/):
>
> <table border=1>
>   <!-- TMPL_LOOP rows -->
>     <tr>
>       <!-- TMPL_LOOP cols -->
>         <!-- TMPL_IF colorful-style -->
>           <td align="right" bgcolor="pink"><!-- TMPL_VAR content --></td>
>         <!-- TMPL_ELSE -->
>           <td align="right" ><!-- TMPL_VAR content --></td>
>         <!-- /TMPL_IF -->
>       <!-- /TMPL_LOOP -->
>     </tr>
>   <!-- /TMPL_LOOP -->
> </table>
>
> is indented in html-mode
>
> <html>
>   <table border=1>
>     <!-- TMPL_LOOP rows -->
>     <tr>
>       <!-- TMPL_LOOP cols -->
>       <!-- TMPL_IF colorful-style -->
>       <td align="right" bgcolor="lime"><!-- TMPL_VAR content --></td>
>       <!-- TMPL_ELSE -->
>       <td align="right" ><!-- TMPL_VAR content --></td>
>       <!-- /TMPL_IF -->
>       <!-- /TMPL_LOOP -->
>     </tr>
>     <!-- /TMPL_LOOP -->
>   </table>
> </html>
>
> because the comment-like tags "<!-- TMPL ..." are unknown. How do I
> teach html-mode to recognize their special meaning?
>
> Jens

-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================


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

* Re: Indentation for html-mode
  2008-04-13 18:54 ` Chris McMahan
@ 2008-04-13 20:32   ` Jens Teich
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Teich @ 2008-04-13 20:32 UTC (permalink / raw)
  To: help-gnu-emacs

Chris McMahan <first_initiallastname@one.dot.net> writes:

> I think the current mode is behaving correctly. The indentation is to
> reflect which elements are parents and children in this case.
> Indenting the <tr> tag after the comments would imply to me that the
> <tr> is a child of the comment, which in turn is a child of the
> <table> tag.

Definitely html-mode treats the the comments correctly. This is out of
question. But here the comments are combined with other meanings which
are not visible when looking at the document with html view. They are
template designers for looping or conditional constructs, so here are
sort of two languages in one document.

> Are you sure you want the comments indented like you described?

Not desperately, just curious.

Jens


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

* Re: Indentation for html-mode
  2008-04-13 17:32   ` Jens Teich
@ 2008-04-13 20:44     ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 6+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-13 20:44 UTC (permalink / raw)
  To: Jens Teich; +Cc: help-gnu-emacs

Jens Teich wrote:
>> It looks like a job for the template library. Doesn't it provide indenting?
> 
> Do you mean http://emacs-template.sourceforge.net/?
> 
> I can't find anything about indentation there.

Yes, I meant that. It is this project that gives a special meaning to 
those comments. If any special indentation should be done I think it 
would be good to have it as a part of that project.




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

end of thread, other threads:[~2008-04-13 20:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-13 11:23 Indentation for html-mode Jens Teich
2008-04-13 12:38 ` Lennart Borgman (gmail)
     [not found] ` <mailman.10322.1208090292.18990.help-gnu-emacs@gnu.org>
2008-04-13 17:32   ` Jens Teich
2008-04-13 20:44     ` Lennart Borgman (gmail)
2008-04-13 18:54 ` Chris McMahan
2008-04-13 20:32   ` Jens Teich

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.