From: "Roland Winkler" <winkler@gnu.org>
To: 39686@debbugs.gnu.org
Cc: gojjoe2@googlemail.com
Subject: bug#39686: 25.2; Wrong behaviour of bibtex-autokey-name-change-strings
Date: Wed, 19 Feb 2020 23:04:13 -0600 [thread overview]
Message-ID: <4941.12888.304926.24142@gargle.gargle.HOWL> (raw)
In-Reply-To: <handler.39686.B.158217451717286.ack@debbugs.gnu.org>
> I noticed that it doesn't lead to the intended behaviour for '\oe'
> and '\OE', which get converted to 'oee' rather than 'oe'. On the
> other hand, '\o', '\"o', and their capitalized counterparts are
> correctly converted to 'oe' (and also '\ae' to 'ae').
>
> This quirk seems to be fixed if '\o' and '\oe' are swapped in
> bibtex-autokey-name-change-strings. Then all variants are
> correctly converted.
I suggest that the value of bibtex-autokey-transcriptions should be
calculated by regexp-opt. That makes the code more readable and it
fixes this problem for free.
Can you confirm that the following works as it should?
(defvar bibtex-autokey-transcriptions
(nconc
(mapcar (lambda (a) (cons (regexp-opt (car a)) (cdr a)))
'(;; language specific characters
(("\\aa") . "a") ; \aa -> a
(("\\AA") . "A") ; \AA -> A
(("\"a" "\\\"a" "\\ae") . "ae") ; "a,\"a,\ae -> ae
(("\"A" "\\\"A" "\\AE") . "Ae") ; "A,\"A,\AE -> Ae
(("\\i") . "i") ; \i -> i
(("\\j") . "j") ; \j -> j
(("\\l") . "l") ; \l -> l
(("\\L") . "L") ; \L -> L
(("\"o" "\\\"o" "\\o" "\\oe") . "oe") ; "o,\"o,\o,\oe -> oe
(("\"O" "\\\"O" "\\O" "\\OE") . "Oe") ; "O,\"O,\O,\OE -> Oe
(("\"s" "\\\"s" "\\3") . "ss") ; "s,\"s,\3 -> ss
(("\"u" "\\\"u") . "ue") ; "u,\"u -> ue
(("\"U" "\\\"U") . "Ue") ; "U,\"U -> Ue
;; hyphen, accents
(("\\-" "\\`" "\\'" "\\^" "\\~" "\\=" "\\." "\\u" "\\v"
"\\H" "\\t" "\\c" "\\d" "\\b") . "")
;; space
(("~") . " ")))
;; more spaces
'(("[\s\t\n]*\\(?:\\\\\\)?[\s\t\n]+" . " ")
;; braces, quotes, concatenation.
("[`'\"{}#]" . "")))
"Alist of (OLD-REGEXP . NEW-STRING) pairs.
Used by the default values of `bibtex-autokey-name-change-strings' and
`bibtex-autokey-titleword-change-strings'. Defaults to translating some
language specific characters to their ASCII transcriptions, and
removing any character accents.")
next prev parent reply other threads:[~2020-02-20 5:04 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 [this message]
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
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=4941.12888.304926.24142@gargle.gargle.HOWL \
--to=winkler@gnu.org \
--cc=39686@debbugs.gnu.org \
--cc=gojjoe2@googlemail.com \
/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).