[Top][All Lists]

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

bug#39686: 25.2; Wrong behaviour of bibtex-autokey-name-change-strings

From: Mattias Engdegård
Subject: bug#39686: 25.2; Wrong behaviour of bibtex-autokey-name-change-strings
Date: Fri, 21 Feb 2020 21:43:08 +0100

21 feb. 2020 kl. 21.03 skrev Roland Winkler <address@hidden>:

> In LaTeX syntax, OLD-REGEXP can appear anywhere inside what LaTeX
> considers a word (which even may include spaces).  So to make things
> more fool-proofed, it would be necessary to parse more carefully the
> LaTeX code.  I do not think this effort is needed here as these
> regexps have worked well for at least two decades.  The patch fixes
> a minor problem of these regexps pointed out by the OP.  But
> otherwise it preserves their spirit.

In LaTeX you can't just write 'b\oeuf'; it will complain that '\oeuf' is 
undefined. You have to write 'b\oe uf' or 'b{\oe}uf'. Thus there is a word 
break at the end. (Accents, like '\"o', are different; there is only a single 
letter after the '\"'.)
With your table, you replace '\o' with 'oe', but what if the text uses a 
different \-sequence starting with \o, like '\omega'? After substitution, you 
would have 'oemega' which wasn't intended.

Safer then to tack on a zero-width assertion, like


for example. Or, if you think it's hard to read,

(rx "\\" (or "o" "oe") word-end)

reply via email to

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