unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38363: Error in mhtml-syntax-propertize in HTML with inline script
@ 2019-11-24 12:54 Richard Copley
  2019-11-25 16:57 ` bug#38372: " Richard Copley
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Copley @ 2019-11-24 12:54 UTC (permalink / raw)
  To: 38363

[-- Attachment #1: Type: text/plain, Size: 4408 bytes --]

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)

In GNU Emacs 27.0.50 (build 6, x86_64-w64-mingw32)
 of 2019-11-24 built on MACHINE
Repository revision: 5a3e96b17c2a948ac952295962dc6e281ec5cad5
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.19025
System Description: Microsoft Windows 10 Pro (v10.0.1903.19025.1051)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
(New file)
Mark set
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
Configured using:
 'configure --config-cache --with-modules --without-pop --without-dbus
 --without-gconf --without-gsettings CFLAGS=-O2'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2
HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: ENG
  locale-coding-system: cp1252

Major mode: HTML+JS

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc dired dired-loaddefs rfc822
mml mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail vc-git
diff-mode easy-mmode mhtml-mode css-mode smie eww mm-url gnus nnheader
gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums time-date
mail-utils wid-edit mm-util mail-prsvr thingatpt url-queue url url-proxy
url-privacy url-expand url-methods url-history mailcap shr
text-property-search url-cookie url-domsuf url-util url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars puny svg xml browse-url format-spec color js
json subr-x map imenu cc-mode cc-fonts easymenu cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs sgml-mode seq
byte-opt gv bytecomp byte-compile cconv dom cl-loaddefs cl-lib tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads w32notify w32 lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 113316 8380)
 (symbols 48 13210 1)
 (strings 32 40080 2328)
 (string-bytes 1 1310957)
 (vectors 16 18724)
 (vector-slots 8 235664 6880)
 (floats 8 204 73)
 (intervals 56 264 0)
 (buffers 1000 12))

[-- Attachment #2: Type: text/html, Size: 5009 bytes --]

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

* bug#38372: Error in mhtml-syntax-propertize in HTML with inline script
  2019-11-24 12:54 bug#38363: Error in mhtml-syntax-propertize in HTML with inline script Richard Copley
@ 2019-11-25 16:57 ` Richard Copley
  2019-11-25 22:28   ` Dmitry Gutov
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Copley @ 2019-11-25 16:57 UTC (permalink / raw)
  To: 38372

[-- Attachment #1: Type: text/plain, Size: 4408 bytes --]

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)

In GNU Emacs 27.0.50 (build 6, x86_64-w64-mingw32)
 of 2019-11-24 built on MACHINE
Repository revision: 5a3e96b17c2a948ac952295962dc6e281ec5cad5
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.19025
System Description: Microsoft Windows 10 Pro (v10.0.1903.19025.1051)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
(New file)
Mark set
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
Configured using:
 'configure --config-cache --with-modules --without-pop --without-dbus
 --without-gconf --without-gsettings CFLAGS=-O2'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2
HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: ENG
  locale-coding-system: cp1252

Major mode: HTML+JS

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc dired dired-loaddefs rfc822
mml mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail vc-git
diff-mode easy-mmode mhtml-mode css-mode smie eww mm-url gnus nnheader
gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums time-date
mail-utils wid-edit mm-util mail-prsvr thingatpt url-queue url url-proxy
url-privacy url-expand url-methods url-history mailcap shr
text-property-search url-cookie url-domsuf url-util url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars puny svg xml browse-url format-spec color js
json subr-x map imenu cc-mode cc-fonts easymenu cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs sgml-mode seq
byte-opt gv bytecomp byte-compile cconv dom cl-loaddefs cl-lib tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads w32notify w32 lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 113316 8380)
 (symbols 48 13210 1)
 (strings 32 40080 2328)
 (string-bytes 1 1310957)
 (vectors 16 18724)
 (vector-slots 8 235664 6880)
 (floats 8 204 73)
 (intervals 56 264 0)
 (buffers 1000 12))

[-- Attachment #2: Type: text/html, Size: 4921 bytes --]

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

* bug#38372: Error in mhtml-syntax-propertize in HTML with inline script
  2019-11-25 16:57 ` bug#38372: " Richard Copley
@ 2019-11-25 22:28   ` Dmitry Gutov
  2019-11-29 16:52     ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Gutov @ 2019-11-25 22:28 UTC (permalink / raw)
  To: Richard Copley, 38372; +Cc: Tom Tromey, Stefan Monnier

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.





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

* bug#38372: Error in mhtml-syntax-propertize in HTML with inline script
  2019-11-25 22:28   ` Dmitry Gutov
@ 2019-11-29 16:52     ` Stefan Monnier
  2020-05-25  2:10       ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2019-11-29 16:52 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Richard Copley, 38372, Tom Tromey

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

I just pushed a fix for it.


        Stefan






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

* bug#38372: Error in mhtml-syntax-propertize in HTML with inline script
  2019-11-29 16:52     ` Stefan Monnier
@ 2020-05-25  2:10       ` Tom Tromey
  2020-05-25  2:41         ` bug#38363: " Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2020-05-25  2:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Richard Copley, 38372, Tom Tromey, 38363, Dmitry Gutov

Stefan> I just pushed a fix for it.

Can this bug be closed then?

Tom





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

* bug#38363: bug#38372: Error in mhtml-syntax-propertize in HTML with inline script
  2020-05-25  2:10       ` Tom Tromey
@ 2020-05-25  2:41         ` Stefan Monnier
  2021-02-14 18:04           ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2020-05-25  2:41 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Richard Copley, 38372, 38363, Dmitry Gutov

> Stefan> I just pushed a fix for it.
> Can this bug be closed then?

I think so, but it would be good to get confirmation from someone who
actually experienced this problem.


        Stefan






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

* bug#38372: Error in mhtml-syntax-propertize in HTML with inline script
  2020-05-25  2:41         ` bug#38363: " Stefan Monnier
@ 2021-02-14 18:04           ` Tom Tromey
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2021-02-14 18:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Richard Copley, 38372, Tom Tromey, 38363, Dmitry Gutov

>> Can this bug be closed then?

Stefan> I think so, but it would be good to get confirmation from someone who
Stefan> actually experienced this problem.

No response for quite a while, and it's fixed, so I am closing it.

Tom





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

end of thread, other threads:[~2021-02-14 18:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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