all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Richard Copley <rcopley@gmail.com>, 38372@debbugs.gnu.org
Cc: Tom Tromey <tom@tromey.com>, Stefan Monnier <monnier@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	[thread overview]
Message-ID: <38eecd43-3181-6818-0aad-9321f3ea4a1d@yandex.ru> (raw)
In-Reply-To: <CAPM58oiXapMDsugs+aZ_c0x9m_axDErd+EB4oUk5LbMDPx1otA@mail.gmail.com>

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.





  reply	other threads:[~2019-11-25 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24 12:54 bug#38363: Error in mhtml-syntax-propertize in HTML with inline script Richard Copley
2019-11-25 16:57 ` bug#38372: " Richard Copley
2019-11-25 22:28   ` Dmitry Gutov [this message]
2019-11-29 16:52     ` Stefan Monnier
2020-05-25  2:10       ` Tom Tromey
2020-05-25  2:41         ` bug#38363: " Stefan Monnier
2021-02-14 18:04           ` Tom Tromey

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=38eecd43-3181-6818-0aad-9321f3ea4a1d@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=38372@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rcopley@gmail.com \
    --cc=tom@tromey.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 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.