I've made a minor change to the existing code in bibtex.el
; to be more precise, I've modified the function bibtex-generate-url-list
so that it can generate URLs for several more fields (in addition to the DOI and URL fields that the existing code can handle).
I have written the code that I need, that's not a problem. The problem is that I don't know how to make emacs see the changes.
What I tried:
- Back up the original files
bibtex.el.gz
and the byte-compiled versionbibtex.elc
. - Save my changes in the old location and byte-compile the file. So the versions of
bibtex.el.gz
andbibtex.elc
in the directory/usr/local/share/emacs/24.4/lisp/textmodes
now contain my changes. - Restart emacs.
But my changes don't seem to work when I load a bibtex file.
So how can I make emacs use my changes?
For completeness, here is the code I added (everything after the doi entry). I've tested the regular expressions and they do what I want, so that's not the issue, as I explained above.
(defcustom bibtex-generate-url-list
'((("url" . ".*:.*"))
(("doi" . "10\\.[0-9]+/.+")
"http://dx.doi.org/%s"
("doi" ".*" 0))
(("mrkey" . "\\(mr\\)?[0-9]\\{1,8\\}")
"http://www.ams.org/mathscinet-getitem?mr=%s"
("mrkey" "\\(mr\\)?\\([0-9]\\{1,8\\}\\)" 2))
(("arxiv" . "\\([0-9]\\{4\\}\\.[0-9]\\{4,5\\}\\|[-a-z]+/[0-9]\\{7\\}\\|[-a-z]+\\.[a-z]\\{2\\}/[0-9]\\{7\\}\\)\\(v[0-9]+\\)?")
"http://arxiv.org/abs/%s"
("arxiv" ".*" 0))
(("zblnumber" . "\\([0-9]\\{4\\}\\.[0-9]\\{5\\}\\|[0-9]\\{8\\}\\)")
"http://zbmath.org/?q=an:%s"
("zblnumber" ".*" 0)))