GNU bug report logs - #39686
25.2; Wrong behaviour of bibtex-autokey-name-change-strings

Previous Next

Package: emacs;

Reported by: "Roland Winkler" <winkler <at> gnu.org>

Date: Thu, 20 Feb 2020 04:56:02 UTC

Severity: normal

Found in version 25.2

Done: "Roland Winkler" <winkler <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 39686 <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: 39686 <at> debbugs.gnu.org
Cc: gojjoe2 <at> googlemail.com
Subject: Re: 25.2; Wrong behaviour of bibtex-autokey-name-change-strings
Date: Wed, 19 Feb 2020 23:04:13 -0600
> 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.")




This bug report was last modified 5 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.