From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.bugs Subject: bug#39686: 25.2; Wrong behaviour of bibtex-autokey-name-change-strings Date: Wed, 19 Feb 2020 23:04:13 -0600 Message-ID: <4941.12888.304926.24142@gargle.gargle.HOWL> References: <4367.92615.138020.24142@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="43847"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gojjoe2@googlemail.com To: 39686@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 20 06:05:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4e1P-000BI4-EQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Feb 2020 06:05:11 +0100 Original-Received: from localhost ([::1]:36170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4e1N-0000X4-Ul for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Feb 2020 00:05:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49523) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4e1H-0000Wu-9H for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 00:05:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4e1G-0006Ic-7i for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 00:05:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4e1G-0006IU-4A for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 00:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4e1F-0004lt-V6 for bug-gnu-emacs@gnu.org; Thu, 20 Feb 2020 00:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Roland Winkler" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Feb 2020 05:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39686 X-GNU-PR-Package: emacs Original-Received: via spool by 39686-submit@debbugs.gnu.org id=B39686.158217506218284 (code B ref 39686); Thu, 20 Feb 2020 05:05:01 +0000 Original-Received: (at 39686) by debbugs.gnu.org; 20 Feb 2020 05:04:22 +0000 Original-Received: from localhost ([127.0.0.1]:43716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4e0b-0004kq-Q7 for submit@debbugs.gnu.org; Thu, 20 Feb 2020 00:04:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4e0a-0004ke-9D for 39686@debbugs.gnu.org; Thu, 20 Feb 2020 00:04:20 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j4e0V-0005vC-5X; Thu, 20 Feb 2020 00:04:15 -0500 Original-Received: from [2601:240:8300:d3d0:248b:bf11:be2e:5309] (port=48324 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1j4e0T-0003zr-V3; Thu, 20 Feb 2020 00:04:14 -0500 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176274 Archived-At: > 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.")