Internal nXML mode error in nxml-after-change (Wrong type argument: number-or-marker-p, nil), degrading

Bug #258169 reported by Øyvind Stegard
4
Affects Status Importance Assigned to Milestone
nXhtml
Fix Released
Medium
lborgman

Bug Description

Hello,

I've been having difficulties with nxhtml-mode for many versions now, in mumamo-editing. If I open a standard and valid xhtml-document and insert:
<script type="text/javascript">

</script>

it all initially looks OK, and Javascript-mode is enabled for the region. However, as soon as I press TAB (ident), I get an nxml error message telling me it has switched to degraded mode, and the syntax highlighting goes all wrong.

I tried upgrading to Emacs 22.2 (normally used Emacs 22.1 from Ubuntu Hardy repo), but that did not help. I've attached the output of the nxhtml bug report function.

nXhtml version 1.42, GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.9)
 of 2008-08-15 on blackelf, modified by Ubuntu

Major mode: nXML/degraded

Minor modes in effect:
  moz-minor-mode: t
  mlinks-mode: t
  which-function-mode: t
  show-paren-mode: t
  iswitchb-mode: t
  auto-image-file-mode: t
  delete-selection-mode: t
  shell-dirtrack-mode: t
  nxhtml-global-minor-mode: t
  nxhtml-minor-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Using schema /usr/share/emacs22/site-lisp/nxml-mode/schema/xhtml.rnc
Loading /home/oyvind/.elisp/nxhtml/related/javascript.el (source)...done
Loading /home/oyvind/.elisp/nxhtml/related/moz.el (source)...done
subst.major=javascript-mode
Internal nXML mode error in nxml-after-change (Wrong type argument: number-or-marker-p, nil), degrading
Auto-saving...
nXhtml mode version 1.42
Making completion list... [2 times]
Quit
Loading /home/oyvind/.elisp/nxhtml/nxhtml/nxhtml-bug.el (source)...done

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks for the report Öyvind. It was very good also that you attached the normal data from the nxthml-report-bug command.

Unfortunately I can not reproduce this. Can you please do the same thing as you did, starting in a fresh Emacs where only nXhtml have been loaded:

  M-x emacs-Q-nxhtml

and tell me precisely which steps are needed to reproduce the problem?

Changed in nxhtml:
assignee: nobody → lennart-borgman
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Øyvind Stegard (oyvindstegard) wrote :

Hi,

Here are some steps which make it happen for me:
- Start clean Emacs 22.2
$ emacs -Q

- Load nxhtml
M-x load-file ("~/.elisp/nxhtml/autostart.el")

- Switch scratch buffer to nxhtml-mumamo mode
M-x nxhtml-mumamo

I now have a scratch buffer in nxhtml-mumamo-mode and the "Welcome to nXhtml .." window below.

- Complete empty buffer by inserting normal page
Menu -> nXhtml -> Completion and validation -> Complete tag, attribute, etc
I select "Normal page", and I get an XHTML 1.1 template inserted in buffer.
So far, everything is good.

- In the <body>-section of the document I type:

<script type="text/javascript"> (javascript.el+moz.el loads immediately after I've typed the closing quote for the type attribute)

and:

</script>

Go into <script> section and press TAB for indent, and the crash occurs. Actually, now the crash occured before I had the chance to type the closing </script>, right after I pressed ENTER after "<script type="text/javascript">":

*Messages*:
Elapsed time: 0.000064s
Using vacuous schema
Quit
Using schema ~/.elisp/nxhtml/nxml-mode-20041004/schema/xhtml.rnc
subst.major=nxhtml-mode
Loading /home/oyvind/.elisp/nxhtml/related/javascript.el (source)...done
Loading /home/oyvind/.elisp/nxhtml/related/moz.el (source)...done
Internal nXML mode error in nxml-after-change (Wrong type argument: number-or-marker-p, nil), degrading
Making completion list...

Contents of buffer:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
  </head>
  <body>
    <script type="text/javascript">
    </script>
  </body>
</html>

Hope this is helpful in tracking this down ..

Revision history for this message
Øyvind Stegard (oyvindstegard) wrote :

Here's the nxhtml bug report data in the clean emacs instance after the crash:

nXhtml version 1.42, GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.9)
 of 2008-08-15 on blackelf, modified by Ubuntu

Major mode: nXML/degraded

Minor modes in effect:
  moz-minor-mode: t
  mlinks-mode: t
  nxhtml-minor-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: identity

Recent messages:
Elapsed time: 0.002339s
Wrote /home/oyvind/tmp/test.html
Using schema ~/.elisp/nxhtml/nxml-mode-20041004/schema/xhtml.rnc
Using vacuous schema
(benchmark 1 '(mumamo-find-chunks))
Elapsed time: 0.002707s
Using schema ~/.elisp/nxhtml/nxml-mode-20041004/schema/xhtml.rnc
Internal nXML mode error in nxml-after-change (Wrong type argument: number-or-marker-p, nil), degrading
Auto-saving...
Loading /home/oyvind/.elisp/nxhtml/nxhtml/nxhtml-bug.el (source)...done

Revision history for this message
lborgman (lennart-borgman) wrote :

Hi again Öyvind,

I think I have found the problem. Can you please try the latest beta that I just uploaded?

Revision history for this message
Øyvind Stegard (oyvindstegard) wrote :

Hi again !

I tried "nXhtml is version 1.43, zipping date is 20080818", and the crash no longer occurs. I tried provoking it many ways, but it seems very much more robust, now, thanks ;). Of course, should I find other such bugs, I'll be sure to report them here.

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks Öyvind for your help and for confirming that version 1.43 does not have this problem.

Revision history for this message
lborgman (lennart-borgman) wrote :

Fixed in version 1.43 of nXhtml

Changed in nxhtml:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.