Variable: bibtex-generate-url-list
bibtex-generate-url-list is a customizable variable defined in
bibtex.el.gz.
Value
((("url" . ".*:.*"))
(("doi" . "10\\.[0-9]+/.+")
"https://doi.org/%s"
("doi" ".*" 0)))
Documentation
List of schemes for generating the URL of a BibTeX entry.
These schemes are used by bibtex-url.
Each scheme should have one of these forms:
((FIELD . REGEXP))
((FIELD . REGEXP) STEP...)
((FIELD . REGEXP) STRING STEP...)
FIELD is a field name as returned by bibtex-parse-entry.
REGEXP is matched against the text of FIELD. If the match succeeds,
then this scheme is used. If no STRING and STEPs are specified
the matched text is used as the URL, otherwise the URL is built
by evaluating STEPs. If no STRING is specified the STEPs must result
in strings which are concatenated. Otherwise the resulting objects
are passed through format using STRING as format control string.
A STEP is a list (FIELD REGEXP REPLACE). The text of FIELD
is matched against REGEXP, and is replaced with REPLACE.
REPLACE can be a string, or a number (which selects the corresponding
submatch), or a function called with the field's text as argument
and with the match-data properly set.
Case is always ignored. Always remove the field delimiters.
If bibtex-expand-strings is non-nil, BibTeX strings are expanded
for generating the URL.
Set this variable before loading BibTeX mode.
The following is a complex example, see URL https://link.aps.org/.
((("journal" . "\\\\=<\\(PR[ABCDEL]?\\|RMP\\)\\\\=>")
"http://link.aps.org/abstract/%s/v%s/p%s"
("journal" ".*" upcase)
("volume" ".*" 0)
("pages" "\\`[A-Z]?[0-9]+" 0)))
This variable was added, or its default value changed, in Emacs 24.4.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defcustom bibtex-generate-url-list
'((("url" . ".*:.*"))
(("doi" . "10\\.[0-9]+/.+")
"https://doi.org/%s"
("doi" ".*" 0)))
"List of schemes for generating the URL of a BibTeX entry.
These schemes are used by `bibtex-url'.
Each scheme should have one of these forms:
((FIELD . REGEXP))
((FIELD . REGEXP) STEP...)
((FIELD . REGEXP) STRING STEP...)
FIELD is a field name as returned by `bibtex-parse-entry'.
REGEXP is matched against the text of FIELD. If the match succeeds,
then this scheme is used. If no STRING and STEPs are specified
the matched text is used as the URL, otherwise the URL is built
by evaluating STEPs. If no STRING is specified the STEPs must result
in strings which are concatenated. Otherwise the resulting objects
are passed through `format' using STRING as format control string.
A STEP is a list (FIELD REGEXP REPLACE). The text of FIELD
is matched against REGEXP, and is replaced with REPLACE.
REPLACE can be a string, or a number (which selects the corresponding
submatch), or a function called with the field's text as argument
and with the `match-data' properly set.
Case is always ignored. Always remove the field delimiters.
If `bibtex-expand-strings' is non-nil, BibTeX strings are expanded
for generating the URL.
Set this variable before loading BibTeX mode.
The following is a complex example, see URL `https://link.aps.org/'.
(((\"journal\" . \"\\\\=<\\(PR[ABCDEL]?\\|RMP\\)\\\\=>\")
\"http://link.aps.org/abstract/%s/v%s/p%s\"
(\"journal\" \".*\" upcase)
(\"volume\" \".*\" 0)
(\"pages\" \"\\`[A-Z]?[0-9]+\" 0)))"
:group 'bibtex
:version "24.4"
:type '(repeat
(cons :tag "Scheme"
(cons :tag "Matcher" :extra-offset 4
(string :tag "BibTeX field")
(regexp :tag "Regexp"))
(choice
(const :tag "Take match as is" nil)
(cons :tag "Formatted"
(string :tag "Format control string")
(repeat :tag "Steps to generate URL"
(list (string :tag "BibTeX field")
(regexp :tag "Regexp")
(choice (string :tag "Replacement")
(integer :tag "Sub-match")
(function :tag "Filter")))))
(repeat :tag "Concatenated"
(list (string :tag "BibTeX field")
(regexp :tag "Regexp")
(choice (string :tag "Replacement")
(integer :tag "Sub-match")
(function :tag "Filter")))))))
:risky t)