changeset 5409:a5c38a92e787

(bibtex-field-name, bibtex-field-const, bibtex-field-text): Adapted to Emacs 19 regex rules. (bibtex-reference): Removed one set of parentheses (a workaround).
author Richard M. Stallman <rms@gnu.org>
date Sat, 01 Jan 1994 17:32:23 +0000
parents 22536a487155
children c96b98efb5b4
files lisp/textmodes/bibtex.el
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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")