On Sun, May 16 2021, Nicolas Goaziou wrote: > However, allowing anything means some keys will not be compatible with > some bibliography formats. For example, I doubt BibTeX would appreciate > a percent character in a key.
Careful, trying to find out the details of BibTeX's file format is a quest that I think no-one has ever returned from. :D I have a comment in =parsebib.el= saying that BibTeX allows $ ^ and & in entry keys, despite the fact that those characters are special in TeX... The regexp =parsebib.el= uses for entry keys is this: "[^\"@\\#%',={} \t\n\f]+" Mind you, I have no idea if BibTeX really rejects all these characters (well, I'm pretty sure about the white space... :D ), but even if they are acceptable, they probably don't occur much in the wild. At least I'm not aware of any user complaints since the time I added support for $^&, which was four years ago, > So... let's get liberal and say a key must match: > > (rx "@" (one-or-more (any word "-.:?!`'/*@+|()<>&_^$#%&~"))) > > Nothing bad could happen, right? On a scale of 1 to 10, 1 being getting an error message and having to go online to find out what it means, and 10 being the total and utter destruction of our solar system, I doubt it'll exceed 1. -- Joost Kremers Life has its moments