[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32823: 26.1; nxml-mode: "no matching start-tag" with long entity def

From: Bunkus <moritz
Subject: bug#32823: 26.1; nxml-mode: "no matching start-tag" with long entity definition list
Date: Mon, 24 Sep 2018 14:50:29 +0200


I'm using Emacs to write DocBook XML documents that will be turned into
man pages later. In said XML documents I often define entities used
later in the file. As soon as the that list gets too long (~5
definitions), nxml-mode fails to parse the following structure properly
and fails to close open start tags with the error message "No matching

Note that nxml-mode always states that the document is valid, even
though it fails to find an open start tag (I'm storing DocBook relaxng
schemas in ~/.xml/schemas/relaxng/docbook/4.5/…, but the same is true
when the schemas from /usr/share/emacs/26.1/etc/schema/… are used).

How to reproduce:

1. Save the XML code below into a file.
2. Start emacs -Q
3. Open the test file.
4. Place the cursor at the end of the line starting with "<refentry…".
5. Try using the "nxml-finish-element" function, e.g. C-c C-f. It will
   show the aforementioned error message instead of inserting "</refentry>".
6. Now shorten the entity definition list, e.g. by removing the whole
   line defining "ent5". Execute "normal-mode" to let nxml-mode parse the
   buffer again. Re-run the test from step 5. It will now insert
   "</refentry>" properly.

---[ test file content start 
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" 
<!ENTITY &product; "myprog">
<!ENTITY ent2 "moretext">
<!ENTITY ent3 "evenmoretext">

<!ENTITY ent4 
<!ENTITY ent5 

<refentry lang="en">


  <refpurpose>doing things</refpurpose>

---[ test file content end 

Kind regards

In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-07-05 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12001000
Recent messages:
Saving file /home/mbunkus/tmp/nxml-test.xml...
Wrote /home/mbunkus/tmp/nxml-test.xml
Using schema ~/.xml/schemas/relaxng/docbook/4.5/docbook.rnc
nxml-finish-element-1: No matching start-tag
Saving file /home/mbunkus/tmp/nxml-test.xml...
Wrote /home/mbunkus/tmp/nxml-test.xml
Using schema ~/.xml/schemas/relaxng/docbook/4.5/docbook.rnc
Undo! [2 times]
Saving file /home/mbunkus/tmp/nxml-test.xml...
Wrote /home/mbunkus/tmp/nxml-test.xml

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib 
--localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules 
'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]