/[emacs]/emacs/lisp/textmodes/bibtex.el
ViewVC logotype

Diff of /emacs/lisp/textmodes/bibtex.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.75 by monnier, Mon Jun 2 22:30:09 2003 UTC revision 1.76 by monnier, Mon Jun 2 22:41:50 2003 UTC
# Line 988  was parsed for keys the last time.") Line 988  was parsed for keys the last time.")
988  (defconst bibtex-entry-maybe-empty-head  (defconst bibtex-entry-maybe-empty-head
989    (concat bibtex-entry-head "?")    (concat bibtex-entry-head "?")
990    "Regexp matching the header line of a maybe empty BibTeX entry    "Regexp matching the header line of a maybe empty BibTeX entry
991  (possibly without reference key).")  \(possibly without reference key).")
992    
993  (defconst bibtex-type-in-head 1  (defconst bibtex-type-in-head 1
994    "Regexp subexpression number of the type part in `bibtex-entry-head'.")    "Regexp subexpression number of the type part in `bibtex-entry-head'.")
# Line 1404  delimiters if present." Line 1404  delimiters if present."
1404  The value is actually the tail of LIST whose car matches STRING."  The value is actually the tail of LIST whose car matches STRING."
1405    (let (case-fold-search)    (let (case-fold-search)
1406      (while (and list      (while (and list
1407                  (not (string-match (concat "^" (car list) "$") string)))                  (not (string-match (concat "\\`\\(?:" (car list) "\\)\\'") string)))
1408        (setq list (cdr list)))        (setq list (cdr list)))
1409      list))      list))
1410    
# Line 1414  element of ALIST (case ignored). The val Line 1414  element of ALIST (case ignored). The val
1414  of LIST whose car matches STRING."  of LIST whose car matches STRING."
1415    (let ((case-fold-search t))    (let ((case-fold-search t))
1416      (while (and alist      (while (and alist
1417                  (not (string-match (concat "^" (caar alist) "$") string)))                  (not (string-match (concat "\\`\\(?:" (caar alist) "\\)\\'") string)))
1418        (setq alist (cdr alist)))        (setq alist (cdr alist)))
1419      (car alist)))      (car alist)))
1420    
# Line 1824  Formats current entry according to varia Line 1824  Formats current entry according to varia
1824    
1825                ;; update page dashes                ;; update page dashes
1826                (if (and (memq 'page-dashes format)                (if (and (memq 'page-dashes format)
1827                         (string-match "^\\(OPT\\)?pages\\'" field-name)                         (string-match "\\`\\(OPT\\)?pages\\'" field-name)
1828                         (progn (goto-char beg-text)                         (progn (goto-char beg-text)
1829                                (looking-at                                (looking-at
1830                                 "\\([\"{][0-9]+\\)[ \t\n]*--?[ \t\n]*\\([0-9]+[\"}]\\)")))                                 "\\([\"{][0-9]+\\)[ \t\n]*--?[ \t\n]*\\([0-9]+[\"}]\\)")))
# Line 1965  and return results as a list." Line 1965  and return results as a list."
1965                        ;; Name is of the form "von Last, First" or                        ;; Name is of the form "von Last, First" or
1966                        ;; "von Last, Jr, First"                        ;; "von Last, Jr, First"
1967                        ;; --> Take the first capital part before the comma                        ;; --> Take the first capital part before the comma
1968                        (substring fullname (match-beginning 1) (match-end 1)))                        (match-string 1 fullname))
1969                       ((string-match "\\([^, ]*\\)," fullname)                       ((string-match "\\([^, ]*\\)," fullname)
1970                        ;; Strange name: we have a comma, but nothing capital                        ;; Strange name: we have a comma, but nothing capital
1971                        ;; So we accept even lowercase names                        ;; So we accept even lowercase names
1972                        (substring fullname (match-beginning 1) (match-end 1)))                        (match-string 1 fullname))
1973                       ((string-match "\\(\\<[a-z][^ ]*[ ]+\\)+\\([A-Z][^ ]*\\)"                       ((string-match "\\(\\<[a-z][^ ]* +\\)+\\([A-Z][^ ]*\\)"
1974                                      fullname)                                      fullname)
1975                        ;; name is of the form "First von Last", "von Last",                        ;; name is of the form "First von Last", "von Last",
1976                        ;; "First von von Last", or "d'Last"                        ;; "First von von Last", or "d'Last"
1977                        ;; --> take the first capital part after the "von" parts                        ;; --> take the first capital part after the "von" parts
1978                        (substring fullname (match-beginning 2) (match-end 2)))                        (match-string 2 fullname))
1979                       ((string-match "\\([^ ]+\\)[ ]*$" fullname)                       ((string-match "\\([^ ]+\\) *\\'" fullname)
1980                        ;; name is of the form "First Middle Last" or "Last"                        ;; name is of the form "First Middle Last" or "Last"
1981                        ;; --> take the last token                        ;; --> take the last token
1982                        (substring fullname (match-beginning 1) (match-end 1)))                        (match-string 1 fullname))
1983                       (t (error "Name `%s' is incorrectly formed" fullname)))))                       (t (error "Name `%s' is incorrectly formed" fullname)))))
1984      (bibtex-autokey-abbrev      (bibtex-autokey-abbrev
1985       (funcall bibtex-autokey-name-case-convert name)       (funcall bibtex-autokey-name-case-convert name)
# Line 2233  Use `bibtex-predefined-strings' and bib Line 2233  Use `bibtex-predefined-strings' and bib
2233            (case-fold-search)            (case-fold-search)
2234            compl)            compl)
2235        (dolist (filename bibtex-string-files)        (dolist (filename bibtex-string-files)
2236          (unless (string-match "\.bib$" filename)          (unless (string-match "\\.bib\\'" filename)
2237            (setq filename (concat filename ".bib")))            (setq filename (concat filename ".bib")))
2238          ;; test filenames          ;; test filenames
2239          (let (fullfilename bounds found)          (let (fullfilename bounds found)
# Line 2523  non-nil. Line 2523  non-nil.
2523    (set (make-local-variable 'comment-start-skip)    (set (make-local-variable 'comment-start-skip)
2524         (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*"))         (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*"))
2525    (set (make-local-variable 'comment-column) 0)    (set (make-local-variable 'comment-column) 0)
2526    (set (make-local-variable 'defun-prompt-regexp) "^[ \t]*@[a-zA-Z0-9]+")    (set (make-local-variable 'defun-prompt-regexp) "^[ \t]*@[a-zA-Z0-9]+[ \t]*")
2527    (set (make-local-variable 'outline-regexp) "[ \t]*@")    (set (make-local-variable 'outline-regexp) "[ \t]*@")
2528    (set (make-local-variable 'fill-prefix) (make-string (+ bibtex-entry-offset    (set (make-local-variable 'fill-prefix) (make-string (+ bibtex-entry-offset
2529                                                           bibtex-contline-indentation)                                                           bibtex-contline-indentation)
# Line 2902  Return position of entry if KEY is found Line 2902  Return position of entry if KEY is found
2902                  (when (re-search-forward (concat "^[ \t]*\\("                  (when (re-search-forward (concat "^[ \t]*\\("
2903                                                   bibtex-entry-type                                                   bibtex-entry-type
2904                                                   "\\)[ \t]*[({][ \t\n]*\\("                                                   "\\)[ \t]*[({][ \t\n]*\\("
2905                                                   key "\\)")                                                   (regexp-quote key) "\\)")
2906                                           nil t)                                           nil t)
2907                    (match-beginning 2)))))                    (match-beginning 2)))))
2908      (cond (pnt      (cond (pnt

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26