summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoost Kremers <joostkremers@fastmail.fm>2017-05-01 12:47:15 +0200
committerJoost Kremers <joostkremers@fastmail.fm>2017-05-01 12:47:15 +0200
commitbc31b627c666df576aa37e21c27a2223b3cb91a3 (patch)
tree07bb6cbd2c32be5237db23b28ab0032c84c01287
parent73327c471d92c7716484d8c3cbcdeed1d70ae468 (diff)
Allow $ ^ and & in BibTeX keys and identifiers.
Apparently these characters are allowed in keys etc., even though using them is ill-advised, given the fact that they are special for TeX.
-rw-r--r--parsebib.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/parsebib.el b/parsebib.el
index 33e75a3..d66b39a 100644
--- a/parsebib.el
+++ b/parsebib.el
@@ -151,8 +151,14 @@ combination, the field inherits from the same-name field in the
cross-referenced entry. If no inheritance should take place, the
target field is set to the symbol `none'.")
-(defconst parsebib--bibtex-identifier "[^^\"@\\&$#%',={}() \t\n\f]+" "Regexp describing a licit BibTeX identifier.")
-(defconst parsebib--key-regexp "[^^\"@\\&$#%',={} \t\n\f]+" "Regexp describing a licit key.")
+;; Regexes describing BibTeX identifiers and keys. Note that while $ ^ & are
+;; valid in BibTeX keys, they may nonetheless be problematic, because they are
+;; special for TeX. The difference between `parsebib--bibtex-identifier' and
+;; `parsebib--key-regexp' are the parentheses (), which are valid in keys. It may in
+;; fact not be necessary (or desirable) to distinguish the two, but until
+;; someone complains, I'll keep it this way.
+(defconst parsebib--bibtex-identifier "[^\"@\\#%',={}() \t\n\f]+" "Regexp describing a licit BibTeX identifier.")
+(defconst parsebib--key-regexp "[^\"@\\#%',={} \t\n\f]+" "Regexp describing a licit key.")
(defconst parsebib--entry-start "^[ \t]*@" "Regexp describing the start of an entry.")
;; Emacs 24.3 compatibility code.