unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Jon Dufresne <jon.dufresne@gmail.com>
Cc: 17207@debbugs.gnu.org
Subject: bug#17207: 24.3; html-mode incorrect indentation inside template syntax
Date: Sun, 03 Nov 2019 14:20:45 +0100	[thread overview]
Message-ID: <87eeypdrki.fsf@marxist.se> (raw)
In-Reply-To: <87ppkubgkf.fsf@localhost.i-did-not-set--mail-host-address--so-tickle-me> (Jon Dufresne's message of "Sun, 06 Apr 2014 08:53:04 -0700")

Jon Dufresne <jon.dufresne@gmail.com> writes:

> Create a test.html file. Use html-mode. Fill with the following
> contents:
>
> ```
> <table>
>   <thead>
>     <tr>
>       {% for header in headers %}
> 	<th>{{ header.attr1 }}</th>
>       <th>{{ header.attr2 }}</th>
>       {% endfor %}
>     </tr>
>   </thead>
> </table>
> ```
>
> This is a mix of HTML and Django template syntax [0]. If you indent line
> 6 (<th>{{ header.attr2 }}</th>) I would expect the line to align itself
> with the previous line (<th>{{ header.attr1 }}</th>). Instead it appears
> to aligns itself with the "for" template tag or perhaps the <tr> plus an
> offset. The final result after indenting line 6 is as it appears above.
>
> The mode pony-tpl-mode [1] uses html-mode to calculate indentation when
> then previous line looks like HTML and not special syntax. See my bug
> report there: https://github.com/davidmiller/pony-mode/issues/81
>
> [0] https://docs.djangoproject.com/en/dev/topics/templates/
> [1] https://github.com/davidmiller/pony-mode

This was reported 5 years ago, but unfortunately never got a reply at
the time.

I can reproduce this on current master, but I wonder if it makes sense
to make html-mode support Django template syntax.  Shouldn't there be
a separate (perhaps derived) mode for that?

Best regards,
Stefan Kangas





  reply	other threads:[~2019-11-03 13:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 15:53 bug#17207: 24.3; html-mode incorrect indentation inside template syntax Jon Dufresne
2019-11-03 13:20 ` Stefan Kangas [this message]
2019-11-03 17:23   ` Stefan Kangas
2019-11-04 14:27     ` Dmitry Gutov
2019-11-05  3:09       ` Richard Stallman
2019-11-05  7:39         ` Dmitry Gutov
2019-12-02 11:09   ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eeypdrki.fsf@marxist.se \
    --to=stefan@marxist.se \
    --cc=17207@debbugs.gnu.org \
    --cc=jon.dufresne@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

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