# HG changeset patch # User Richard M. Stallman # Date 757445543 0 # Node ID a5c38a92e7878c990b3e8df10f0b2a1fcb0ac774 # Parent 22536a487155b8ba1aa77f42dbee8887d76e017c (bibtex-field-name, bibtex-field-const, bibtex-field-text): Adapted to Emacs 19 regex rules. (bibtex-reference): Removed one set of parentheses (a workaround). diff -r 22536a487155 -r a5c38a92e787 lisp/textmodes/bibtex.el --- a/lisp/textmodes/bibtex.el Sat Jan 01 17:15:40 1994 +0000 +++ b/lisp/textmodes/bibtex.el Sat Jan 01 17:32:23 1994 +0000 @@ -455,8 +455,12 @@ ;;; Amendment: I couldn't get a regexp with both "[]"'s and hyphen to ;;; work. It looks like you need them both to be the first entries in a ;;; regexp pattern. [alarson:19930315.0900CST] +;;; +;;; New amendment[MB]: I have corrected the following regexp according to +;;; emacs19 rules. I also added ']' to the list of characters allowed in +;;; a field name. -(defconst bibtex-field-name "[A-Za-z][---A-Za-z0-9.:;?!`'()/*@_+=]*" +(defconst bibtex-field-name "[A-Za-z][]A-Za-z0-9.:;?!`'()/*@_+=-]*" "Regexp defining the name part of a bibtex field.") ;; bibtex-field-text must be able to handle @@ -469,7 +473,7 @@ ;; i have added a few of these, but not all! -- MON (defconst bibtex-field-const - "[0-9A-Za-z][---A-Za-z0-9:_+]*" + "[0-9A-Za-z][A-Za-z0-9:_+-]*" "Format of a bibtex field constant.") (defconst bibtex-field-string @@ -491,7 +495,7 @@ Also matches simple {...} patterns.") ;(defconst bibtex-field-text -; "\"[^\"]*[^\\\\]\"\\|\"\"\\|[0-9A-Za-z][---A-Za-z0-9:_+]*" +; "\"[^\"]*[^\\\\]\"\\|\"\"\\|[0-9A-Za-z][A-Za-z0-9:_+-]*" ; "Regexp defining the text part of a bibtex field: either a string, or an empty string, or a constant.") (defconst bibtex-field @@ -521,9 +525,16 @@ bibtex-reference-head") (defconst bibtex-reference - (concat bibtex-reference-head - "\\([ \t\n]*" bibtex-field "\\)*" - "[ \t\n]*[})]") + (concat + ;; This is the unparenthesized equivalent of bibtex-reference-head: + "^[ \t]*" + bibtex-reference-type + "[ \t]*[({]\\(" + bibtex-field-name + "\\)" + ;; End of unparenthesized equivalent of bibtex-reference-head + "\\([ \t\n]*" bibtex-field "\\)*" + "[ \t\n]*[})]") "Regexp defining the format of a bibtex reference entry") (defconst bibtex-type-in-reference bibtex-type-in-head "The regexp subexpression number of the type part in bibtex-reference")