From: Dmitry Gutov <dgutov@yandex.ru>
To: 14003@debbugs.gnu.org
Subject: bug#14003: 24.3.50; sgml-mode: support angle brackets inside jsp tags
Date: Wed, 20 Mar 2013 07:36:59 +0400 [thread overview]
Message-ID: <87k3p2rbc4.fsf@yandex.ru> (raw)
sgml-mode has some support for preprocessing tags.
When it sees tags with percent characters inside (<% hello! %>), it says
that the tag's type is `jsp'.
The templating engine may be different (e.g. ERB or EJS), but all of
these examples can have arbitrary code inside, including angle brackets,
usually serving as comparison operators.
Before revno:111900, only having "<" inside a `jsp' tag was a problem:
it broke indentation on the following lines, until a closing containing
tag. With the aforementioned revision, having either "<" or ">" inside a
`jsp' tag breaks string highlighting, because they changes the depth in
parens returned by (syntax-ppss).
So, the previously discussed general problem
(http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00238.html)
got worse in practice.
I think we can make it better in this specific case without solving it
in general, and doing it for html-mode would be a big win.
Roughly, I propose to add a rule in sgml-syntax-propertize-function that
would forcibly mark all angle brackets between <% and %> as punctuation
syntax. Testing it with
(with-silent-modifications
(put-text-property (point) (1+ (point))
'syntax-table (string-to-syntax ".")))
seems to help both with highlighting and indentation.
Before I started writing this text, I had another approach in mind, but
this is something that I can probably do in mmm-mode instead, without
changing sgml-mode, by wrapping submodes' syntax-propertize-functions.
Still, doing it sgml-mode should be simpler.
Thoughts?
next reply other threads:[~2013-03-20 3:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 3:36 Dmitry Gutov [this message]
2013-03-26 16:49 ` bug#14003: 24.3.50; sgml-mode: support angle brackets inside jsp tags Stefan Monnier
2013-04-01 13:32 ` Stefan Monnier
2013-04-01 20:43 ` Dmitry Gutov
2013-04-03 18:25 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k3p2rbc4.fsf@yandex.ru \
--to=dgutov@yandex.ru \
--cc=14003@debbugs.gnu.org \
/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 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.