aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Winkler2020-03-06 09:37:55 +0100
committerRoland Winkler2020-03-06 09:37:55 +0100
commitcb1877321b8a04cdb9b890d76d99a9f5a7ed5bce (patch)
treede4589cc7971ac9ca79075c53de579cf08c5fb16
parent3f9c340de04d7572b02ef1a4c3793420d29a768c (diff)
downloademacs-cb1877321b8a04cdb9b890d76d99a9f5a7ed5bce.tar.gz
emacs-cb1877321b8a04cdb9b890d76d99a9f5a7ed5bce.zip
Use regexp-opt to define bibtex-autokey-transcriptions. (Bug#39686)
-rw-r--r--lisp/textmodes/bibtex.el50
1 files changed, 27 insertions, 23 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index a7be57e5a3f..670e763814c 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1006,32 +1006,36 @@ See `bibtex-generate-autokey' for details."
1006 :type 'boolean) 1006 :type 'boolean)
1007 1007
1008(defvar bibtex-autokey-transcriptions 1008(defvar bibtex-autokey-transcriptions
1009 '(;; language specific characters 1009 (nconc
1010 ("\\\\aa" . "a") ; \aa -> a 1010 (mapcar (lambda (a) (cons (regexp-opt (car a)) (cdr a)))
1011 ("\\\\AA" . "A") ; \AA -> A 1011 '(;; language specific characters
1012 ("\\\"a\\|\\\\\\\"a\\|\\\\ae" . "ae") ; "a,\"a,\ae -> ae 1012 (("\\aa") . "a") ; \aa -> a
1013 ("\\\"A\\|\\\\\\\"A\\|\\\\AE" . "Ae") ; "A,\"A,\AE -> Ae 1013 (("\\AA") . "A") ; \AA -> A
1014 ("\\\\i" . "i") ; \i -> i 1014 (("\"a" "\\\"a" "\\ae") . "ae") ; "a,\"a,\ae -> ae
1015 ("\\\\j" . "j") ; \j -> j 1015 (("\"A" "\\\"A" "\\AE") . "Ae") ; "A,\"A,\AE -> Ae
1016 ("\\\\l" . "l") ; \l -> l 1016 (("\\i") . "i") ; \i -> i
1017 ("\\\\L" . "L") ; \L -> L 1017 (("\\j") . "j") ; \j -> j
1018 ("\\\"o\\|\\\\\\\"o\\|\\\\o\\|\\\\oe" . "oe") ; "o,\"o,\o,\oe -> oe 1018 (("\\l") . "l") ; \l -> l
1019 ("\\\"O\\|\\\\\\\"O\\|\\\\O\\|\\\\OE" . "Oe") ; "O,\"O,\O,\OE -> Oe 1019 (("\\L") . "L") ; \L -> L
1020 ("\\\"s\\|\\\\\\\"s\\|\\\\3" . "ss") ; "s,\"s,\3 -> ss 1020 (("\"o" "\\\"o" "\\o" "\\oe") . "oe") ; "o,\"o,\o,\oe -> oe
1021 ("\\\"u\\|\\\\\\\"u" . "ue") ; "u,\"u -> ue 1021 (("\"O" "\\\"O" "\\O" "\\OE") . "Oe") ; "O,\"O,\O,\OE -> Oe
1022 ("\\\"U\\|\\\\\\\"U" . "Ue") ; "U,\"U -> Ue 1022 (("\"s" "\\\"s" "\\3") . "ss") ; "s,\"s,\3 -> ss
1023 ;; accents 1023 (("\"u" "\\\"u") . "ue") ; "u,\"u -> ue
1024 ("\\\\`\\|\\\\'\\|\\\\\\^\\|\\\\~\\|\\\\=\\|\\\\\\.\\|\\\\u\\|\\\\v\\|\\\\H\\|\\\\t\\|\\\\c\\|\\\\d\\|\\\\b" . "") 1024 (("\"U" "\\\"U") . "Ue") ; "U,\"U -> Ue
1025 ;; braces, quotes, concatenation. 1025 ;; hyphen, accents
1026 ("[`'\"{}#]" . "") 1026 (("\\-" "\\`" "\\'" "\\^" "\\~" "\\=" "\\." "\\u" "\\v"
1027 ("\\\\-" . "") ; \- -> 1027 "\\H" "\\t" "\\c" "\\d" "\\b") . "")
1028 ;; spaces 1028 ;; space
1029 ("\\\\?[ \t\n]+\\|~" . " ")) 1029 (("~") . " ")))
1030 ;; more spaces
1031 '(("[\s\t\n]*\\(?:\\\\\\)?[\s\t\n]+" . " ")
1032 ;; braces, quotes, concatenation.
1033 ("[`'\"{}#]" . "")))
1030 "Alist of (OLD-REGEXP . NEW-STRING) pairs. 1034 "Alist of (OLD-REGEXP . NEW-STRING) pairs.
1031Used by the default values of `bibtex-autokey-name-change-strings' and 1035Used as default values of `bibtex-autokey-name-change-strings' and
1032`bibtex-autokey-titleword-change-strings'. Defaults to translating some 1036`bibtex-autokey-titleword-change-strings'. Defaults to translating some
1033language specific characters to their ASCII transcriptions, and 1037language specific characters to their ASCII transcriptions, and
1034removing any character accents.") 1038removing any accent characters.")
1035 1039
1036(defcustom bibtex-autokey-name-change-strings 1040(defcustom bibtex-autokey-name-change-strings
1037 bibtex-autokey-transcriptions 1041 bibtex-autokey-transcriptions