Stefan Monnier writes: >> In an nxml-mode buffer, put the following text: >> >> >> >> Only "foo" is fontified in as a string, while bar is not. > > IIRC this is technically correct because IIRC in XML (contrary to SGML) > only "..." is allowed and not '...'. Don't take my word for it, tho, > it's just a vague recollection. Well, I was pretty sure that XML allows both quotes, but just to make things definitive, https://www.w3.org/TR/xml/#NT-AttValue: [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" I found this for SGML http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P34: [34] attribute value literal = ( lit , " replaceable character data [46] *, lit ) | " ( lita , ' replaceable character data [46] *, lita ) ' > This said, it's probably a good idea to understand '...' in nxml-mode, > since there are various circumstances where you may want to use > nxml-mode to edit files in a format that's more permissive than strict XML. > >> This is a regression since Emacs 25.3. > > Even more reason to allow '...'. > Have you investigated the source of the regression? I didn't actually checkout and compile before+after, but I'm pretty sure it's [56e1097584], same as Bug#32003. [56e1097584]: 2016-01-16 15:03:42 -0500 lisp/nxml: Use syntax-tables for comments https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=56e1097584c13f2b6db85592769db1c6c36e9419 >> The patch below seems solves problem, though I'm not entirely sure >> about it: there are some confusing comments in sgml-mode.el about >> drawbacks and tradeoffs of recognizing single quotes that I'm not >> really following (are they applicable to SGML only, and not XML?). > > IIRC the comments aren't related to the issue of accepting '...' itself, > but to some of the side-effects of doing it naively in cases such as > > That's right! > > but we're no so naive any more, so I believe that we can support this > without the downsides. >> + (setq-local syntax-ppss-table nxml-tag-syntax-table) >> + (setq-local syntax-propertize-function #'nxml-syntax-propertize) > > Hmm... I think it would be better to change `sgml-syntax-propertize` so > it does what we need. After all, it's more important to support '...' > for SGML than for XML. s/more/equally/, but otherwise yes. Patching sgml-mode is shorter and even fixes Bug#8203 as well. Still good for emacs-26 I hope, since this is for an (nxml-mode) regression in 26.1.