unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Roland Winkler <winkler@gnu.org>
Cc: gojjoe2@googlemail.com, 39686@debbugs.gnu.org
Subject: bug#39686: 25.2; Wrong behaviour of bibtex-autokey-name-change-strings
Date: Fri, 21 Feb 2020 21:43:08 +0100	[thread overview]
Message-ID: <6F3F5510-4567-47A2-B0AA-88E2FED57167@acm.org> (raw)
In-Reply-To: <14225.14543.383801.24144@gargle.gargle.HOWL>

21 feb. 2020 kl. 21.03 skrev Roland Winkler <winkler@gnu.org>:

> 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

"\\\\\\(?:o\\|oe\\)\\>"

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

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







  reply	other threads:[~2020-02-21 20:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20  4:54 bug#39686: 25.2; Wrong behaviour of bibtex-autokey-name-change-strings Roland Winkler
     [not found] ` <handler.39686.B.158217451717286.ack@debbugs.gnu.org>
2020-02-20  5:04   ` Roland Winkler
2020-02-21  9:22     ` gojjoe2--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-02-21 14:06       ` Roland Winkler
2020-02-21 14:08         ` gojjoe2--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-02-21 14:13     ` Roland Winkler
2020-02-21 15:01       ` Eli Zaretskii
2020-02-21 19:50         ` Roland Winkler
2020-02-22  9:12           ` Eli Zaretskii
2020-03-06  8:46             ` Roland Winkler
2020-02-21 16:05 ` Mattias Engdegård
2020-02-21 20:03   ` Roland Winkler
2020-02-21 20:43     ` Mattias Engdegård [this message]
2020-02-21 21:03       ` Roland Winkler
2020-02-21 21:32         ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6F3F5510-4567-47A2-B0AA-88E2FED57167@acm.org \
    --to=mattiase@acm.org \
    --cc=39686@debbugs.gnu.org \
    --cc=gojjoe2@googlemail.com \
    --cc=winkler@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).