unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7204: html-mode do not match { } when there is a if with <
@ 2010-10-12 21:08 Guy Leblanc
  2010-10-13  1:28 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Guy Leblanc @ 2010-10-12 21:08 UTC (permalink / raw)
  To: 7204

GNU Emacs 23.2.1 (i386-mingw-nt5.1.2600) of 2010-05-08 on G41R2F1
It is an unmodified Emacs.

Code with the problem

<!-- Begin of the file with the bug -->

<html>
<head>
<title></title>
<script type="text/javascript">

      function test(){
        aVar = 2;
        if (aVar < 5){ //  This is the problematic if 
          alert("Test();");
        }
      } //   If you remove } and add again } emacs tell you Mismatched 
parenthesis
    
</script>

</head>
<body>
  Hello world!
</body>
</html>
<!-- End of the file the bug -->


<!-- Begin of a file without problem-->

<html>
<head>
<title></title>
<script type="text/javascript">

      function test(){
        aVar = true;
        if (aVar){
          alert("Test();");
        }
      } // <--  If you remove } and add again } emacs can match parenthesis
    
</script>

</head>
<body>
  Hello world!
</body>
</html>
<!-- End of a file without problem -->





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

* bug#7204: html-mode do not match { } when there is a if with <
  2010-10-12 21:08 bug#7204: html-mode do not match { } when there is a if with < Guy Leblanc
@ 2010-10-13  1:28 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2010-10-13  1:28 UTC (permalink / raw)
  To: Guy Leblanc; +Cc: 7204

html-mode is not clever enough to know about scripts.  So in html-mode,
"<" is treated as a kind of open-paren, just like ( and { and that
applies inside <script>...</script> just like elsewhere.

To fix this, you need support for "multiple major modes" or
something similar.  You may wan to check mmm-mode.el or nxhtml or
multi-mode.el, ...


        Stefan





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

end of thread, other threads:[~2010-10-13  1:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-12 21:08 bug#7204: html-mode do not match { } when there is a if with < Guy Leblanc
2010-10-13  1:28 ` Stefan Monnier

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