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'.") |
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 |
|
|
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 |
|
|
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]+[\"}]\\)"))) |
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) |
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) |
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) |
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 |