Subject: Re: bug#61514: 30.0.50; sadistically long xml line hangs emacs

From: Gregory Heytings <[email-masked]>
Date: Mon, 20 Feb 2023 14:06:12 +0000

>
> I think it does.  E.g. there's a chance that using "[^<>\n]+?\\<" 
> instead of "[^<>\n]+?" avoids the hang (not sure if it's the right thing 
> to do for all the regexp that can be returned by `xmltok-attribute`, 
> tho).
>

That does work, indeed.  Using e.g. "[^<>\n]\\{1,100\\}?" also works (but 
is not as efficient).  Perhaps Mark (who added xmltok.el to Emacs in 2007) 
can help here to determine what the right thing is?

>
> And for the stack overflow I haven't yet found its origin.
>

There is no stack overflow here, AFAIU.  It's simply that the prepended 
regexp matches one or more (without any upper bound) characters except 
"<>\n", which means that we backtrack _a lot_ when the line is long.