unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32823: 26.1; nxml-mode: "no matching start-tag" with long entity definition list
@ 2018-09-24 12:50 Moritz, Bunkus <moritz
  2018-09-24 16:25 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Moritz, Bunkus <moritz @ 2018-09-24 12:50 UTC (permalink / raw)
  To: 32823

Hey,

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
start-tag".

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" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[
<!ENTITY &product; "myprog">
<!ENTITY ent2 "moretext">
<!ENTITY ent3 "evenmoretext">

<!ENTITY ent4 "<citerefentry><refentrytitle>anotherprogram</refentrytitle><manvolnum>1</manvolnum></citerefentry>">
<!ENTITY ent5 "<citerefentry><refentrytitle>onemoreprogram</refentrytitle><manvolnum>1</manvolnum></citerefentry>">
]
>

<refentry lang="en">
 <refentryinfo>
  <productname>&product;</productname>
 </refentryinfo>

 <refmeta>
  <refentrytitle>&product;</refentrytitle>
 </refmeta>

 <refnamediv>
  <refname>&product;</refname>
  <refpurpose>doing things</refpurpose>
 </refnamediv>

 <refsect1>
  <title>Test</title>
  <para>here</para>
 </refsect1>
</refentry>
---[ test file content end ]-----------------------------------------------------

Kind regards
mosu

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 -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'





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

end of thread, other threads:[~2019-06-04 14:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-24 12:50 bug#32823: 26.1; nxml-mode: "no matching start-tag" with long entity definition list Moritz, Bunkus <moritz
2018-09-24 16:25 ` Eli Zaretskii
2018-09-24 17:12   ` Moritz Bunkus
2018-09-24 17:26     ` Eli Zaretskii
2018-09-24 17:51       ` Moritz Bunkus
2018-09-25  6:56         ` Eli Zaretskii
2019-05-27 19:22           ` npostavs
2019-05-27 20:01             ` Moritz Bunkus
2019-05-27 20:35               ` npostavs
2019-05-28 15:39                 ` Moritz Bunkus
2019-05-29 23:40                   ` Noam Postavsky
2019-05-30 13:22                     ` Moritz Bunkus
2019-05-30 22:08                     ` Vincent Lefevre
2019-06-02 17:50                       ` Vincent Lefevre
2019-06-04 12:59                         ` Noam Postavsky
2019-06-04 14:29                           ` Vincent Lefevre

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