emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/bibtex.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/bibtex.el
Date: Mon, 02 Jun 2003 18:41:50 -0400

Index: emacs/lisp/textmodes/bibtex.el
diff -c emacs/lisp/textmodes/bibtex.el:1.75 emacs/lisp/textmodes/bibtex.el:1.76
*** emacs/lisp/textmodes/bibtex.el:1.75 Mon Jun  2 18:30:09 2003
--- emacs/lisp/textmodes/bibtex.el      Mon Jun  2 18:41:50 2003
***************
*** 988,994 ****
  (defconst bibtex-entry-maybe-empty-head
    (concat bibtex-entry-head "?")
    "Regexp matching the header line of a maybe empty BibTeX entry
! (possibly without reference key).")
  
  (defconst bibtex-type-in-head 1
    "Regexp subexpression number of the type part in `bibtex-entry-head'.")
--- 988,994 ----
  (defconst bibtex-entry-maybe-empty-head
    (concat bibtex-entry-head "?")
    "Regexp matching the header line of a maybe empty BibTeX entry
! \(possibly without reference key).")
  
  (defconst bibtex-type-in-head 1
    "Regexp subexpression number of the type part in `bibtex-entry-head'.")
***************
*** 1404,1410 ****
  The value is actually the tail of LIST whose car matches STRING."
    (let (case-fold-search)
      (while (and list
!                 (not (string-match (concat "^" (car list) "$") string)))
        (setq list (cdr list)))
      list))
  
--- 1404,1410 ----
  The value is actually the tail of LIST whose car matches STRING."
    (let (case-fold-search)
      (while (and list
!                 (not (string-match (concat "\\`\\(?:" (car list) "\\)\\'") 
string)))
        (setq list (cdr list)))
      list))
  
***************
*** 1414,1420 ****
  of LIST whose car matches STRING."
    (let ((case-fold-search t))
      (while (and alist
!                 (not (string-match (concat "^" (caar alist) "$") string)))
        (setq alist (cdr alist)))
      (car alist)))
  
--- 1414,1420 ----
  of LIST whose car matches STRING."
    (let ((case-fold-search t))
      (while (and alist
!                 (not (string-match (concat "\\`\\(?:" (caar alist) "\\)\\'") 
string)))
        (setq alist (cdr alist)))
      (car alist)))
  
***************
*** 1824,1830 ****
  
                ;; update page dashes
                (if (and (memq 'page-dashes format)
!                        (string-match "^\\(OPT\\)?pages\\'" field-name)
                         (progn (goto-char beg-text)
                                (looking-at
                                 "\\([\"{][0-9]+\\)[ \t\n]*--?[ 
\t\n]*\\([0-9]+[\"}]\\)")))
--- 1824,1830 ----
  
                ;; update page dashes
                (if (and (memq 'page-dashes format)
!                        (string-match "\\`\\(OPT\\)?pages\\'" field-name)
                         (progn (goto-char beg-text)
                                (looking-at
                                 "\\([\"{][0-9]+\\)[ \t\n]*--?[ 
\t\n]*\\([0-9]+[\"}]\\)")))
***************
*** 1965,1985 ****
                        ;; Name is of the form "von Last, First" or
                        ;; "von Last, Jr, First"
                        ;; --> Take the first capital part before the comma
!                       (substring fullname (match-beginning 1) (match-end 1)))
                       ((string-match "\\([^, ]*\\)," fullname)
                        ;; Strange name: we have a comma, but nothing capital
                        ;; So we accept even lowercase names
!                       (substring fullname (match-beginning 1) (match-end 1)))
!                      ((string-match "\\(\\<[a-z][^ ]*[ ]+\\)+\\([A-Z][^ ]*\\)"
                                      fullname)
                        ;; name is of the form "First von Last", "von Last",
                        ;; "First von von Last", or "d'Last"
                        ;; --> take the first capital part after the "von" parts
!                       (substring fullname (match-beginning 2) (match-end 2)))
!                      ((string-match "\\([^ ]+\\)[ ]*$" fullname)
                        ;; name is of the form "First Middle Last" or "Last"
                        ;; --> take the last token
!                       (substring fullname (match-beginning 1) (match-end 1)))
                       (t (error "Name `%s' is incorrectly formed" fullname)))))
      (bibtex-autokey-abbrev
       (funcall bibtex-autokey-name-case-convert name)
--- 1965,1985 ----
                        ;; Name is of the form "von Last, First" or
                        ;; "von Last, Jr, First"
                        ;; --> Take the first capital part before the comma
!                       (match-string 1 fullname))
                       ((string-match "\\([^, ]*\\)," fullname)
                        ;; Strange name: we have a comma, but nothing capital
                        ;; So we accept even lowercase names
!                       (match-string 1 fullname))
!                      ((string-match "\\(\\<[a-z][^ ]* +\\)+\\([A-Z][^ ]*\\)"
                                      fullname)
                        ;; name is of the form "First von Last", "von Last",
                        ;; "First von von Last", or "d'Last"
                        ;; --> take the first capital part after the "von" parts
!                       (match-string 2 fullname))
!                      ((string-match "\\([^ ]+\\) *\\'" fullname)
                        ;; name is of the form "First Middle Last" or "Last"
                        ;; --> take the last token
!                       (match-string 1 fullname))
                       (t (error "Name `%s' is incorrectly formed" fullname)))))
      (bibtex-autokey-abbrev
       (funcall bibtex-autokey-name-case-convert name)
***************
*** 2233,2239 ****
            (case-fold-search)
            compl)
        (dolist (filename bibtex-string-files)
!         (unless (string-match "\.bib$" filename)
            (setq filename (concat filename ".bib")))
          ;; test filenames
          (let (fullfilename bounds found)
--- 2233,2239 ----
            (case-fold-search)
            compl)
        (dolist (filename bibtex-string-files)
!         (unless (string-match "\\.bib\\'" filename)
            (setq filename (concat filename ".bib")))
          ;; test filenames
          (let (fullfilename bounds found)
***************
*** 2523,2529 ****
    (set (make-local-variable 'comment-start-skip)
         (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*"))
    (set (make-local-variable 'comment-column) 0)
!   (set (make-local-variable 'defun-prompt-regexp) "^[ address@hidden")
    (set (make-local-variable 'outline-regexp) "[ \t]*@")
    (set (make-local-variable 'fill-prefix) (make-string (+ bibtex-entry-offset
                                                           
bibtex-contline-indentation)
--- 2523,2529 ----
    (set (make-local-variable 'comment-start-skip)
         (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*"))
    (set (make-local-variable 'comment-column) 0)
!   (set (make-local-variable 'defun-prompt-regexp) "^[ address@hidden \t]*")
    (set (make-local-variable 'outline-regexp) "[ \t]*@")
    (set (make-local-variable 'fill-prefix) (make-string (+ bibtex-entry-offset
                                                           
bibtex-contline-indentation)
***************
*** 2902,2908 ****
                  (when (re-search-forward (concat "^[ \t]*\\("
                                                   bibtex-entry-type
                                                   "\\)[ \t]*[({][ \t\n]*\\("
!                                                  key "\\)")
                                           nil t)
                    (match-beginning 2)))))
      (cond (pnt
--- 2902,2908 ----
                  (when (re-search-forward (concat "^[ \t]*\\("
                                                   bibtex-entry-type
                                                   "\\)[ \t]*[({][ \t\n]*\\("
!                                                  (regexp-quote key) "\\)")
                                           nil t)
                    (match-beginning 2)))))
      (cond (pnt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]