GNU bug report logs - #38372
Error in mhtml-syntax-propertize in HTML with inline script

Previous Next

Package: emacs;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Mon, 25 Nov 2019 21:33:42 UTC

Severity: normal

Merged with 38363

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Richard Copley <rcopley <at> gmail.com>, 38372 <at> debbugs.gnu.org
Cc: Tom Tromey <tom <at> tromey.com>, Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: bug#38372: Error in mhtml-syntax-propertize in HTML with inline script
Date: Tue, 26 Nov 2019 00:28:47 +0200
On 25.11.2019 18:57, Richard Copley wrote:
> HTML with inline script can cause an error in mhtml-syntax-propertize.
> 
> Recipe from emacs -Q: Visit a new file "index.html" and insert these 
> contents:
> 
> <html>
>    <head>
>      <script> 0 </script>
>    </head>
>    <body>
>      it's
>    </body>
> </html>
> 
> Put the cursor after the zero and type a semicolon. An error is signalled.
> 
> (Note the "unmatched" apostrophe in the HTML body.)
> 
> Errors:
> Error during redisplay: (jit-lock-function 1) signaled 
> (wrong-type-argument number-or-marker-p nil)
> mhtml-syntax-propertize: Wrong type argument: number-or-marker-p, nil
> 
> Backtrace:
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>    sgml--syntax-propertize-ppss(86)
>    mhtml-syntax-propertize(33 107)
>    syntax-propertize(50)
>    syntax-ppss()
>    electric-indent-post-self-insert-function()
>    self-insert-command(1 59)
>    funcall-interactively(self-insert-command 1 59)
>    call-interactively(self-insert-command nil nil)
>    command-execute(self-insert-command)

Seems it's only triggered when electric-indent-mode is on.

And the error is in sgml--syntax-propertize-ppss, a function that was 
added after mhtml-mode was written.

A quick attempt at fixing it (adding "sgml--syntax-" to 
mhtml--crucial-variable-prefix) didn't help, so I'm just going to Cc the 
people who might have better idea.




This bug report was last modified 4 years and 97 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.