[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/bibtex.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/bibtex.el [lexbind] |
Date: |
Tue, 06 Jul 2004 05:58:18 -0400 |
Index: emacs/lisp/textmodes/bibtex.el
diff -c emacs/lisp/textmodes/bibtex.el:1.69.2.5
emacs/lisp/textmodes/bibtex.el:1.69.2.6
*** emacs/lisp/textmodes/bibtex.el:1.69.2.5 Tue Jul 6 09:23:48 2004
--- emacs/lisp/textmodes/bibtex.el Tue Jul 6 09:39:54 2004
***************
*** 1793,1799 ****
(goto-char (point-min))
(let* ((fields-alist (bibtex-parse-entry))
(case-fold-search t)
! (field (bibtex-assoc-regexp "\\(OPT\\)?crossref\\>"
fields-alist)))
(setq crossref-key (and field
(not (string-match bibtex-empty-field-re
--- 1793,1799 ----
(goto-char (point-min))
(let* ((fields-alist (bibtex-parse-entry))
(case-fold-search t)
! (field (bibtex-assoc-regexp "\\`\\(OPT\\)?crossref\\'"
fields-alist)))
(setq crossref-key (and field
(not (string-match bibtex-empty-field-re
***************
*** 1807,1813 ****
(when (nth 3 rfield) ; we should have an alternative
(setq alternatives-there t
field (bibtex-assoc-regexp
! (concat "\\(ALT\\)?" (car rfield) "\\>")
fields-alist))
(if (and field
(not (string-match bibtex-empty-field-re
--- 1807,1813 ----
(when (nth 3 rfield) ; we should have an alternative
(setq alternatives-there t
field (bibtex-assoc-regexp
! (concat "\\`\\(ALT\\)?" (car rfield) "\\'")
fields-alist))
(if (and field
(not (string-match bibtex-empty-field-re
***************
*** 2317,2323 ****
;; user has aborted by typing a key --> return `aborted'
(throw 'userkey 'aborted))
(setq key (bibtex-reference-key-in-string bounds))
! (if (not (assoc-string key strings t))
(push (cons key (bibtex-text-in-string bounds t))
strings))
(goto-char (bibtex-end-of-text-in-string bounds)))
--- 2317,2323 ----
;; user has aborted by typing a key --> return `aborted'
(throw 'userkey 'aborted))
(setq key (bibtex-reference-key-in-string bounds))
! (if (not (assoc key strings))
(push (cons key (bibtex-text-in-string bounds t))
strings))
(goto-char (bibtex-end-of-text-in-string bounds)))
***************
*** 2722,2745 ****
(let* ((fields-alist (bibtex-parse-entry))
(field-list (bibtex-field-list
(substring (cdr (assoc "=type=" fields-alist))
! 1)))) ; don't want @
(dolist (field (car field-list))
! (unless (assoc-string (car field) fields-alist t)
(bibtex-make-field field)))
(dolist (field (cdr field-list))
! (unless (assoc-string (car field) fields-alist t)
(bibtex-make-optional-field field))))))
(defun bibtex-parse-entry ()
"Parse entry at point, return an alist.
The alist elements have the form (FIELD . TEXT), where FIELD can also be
! the special strings \"=type=\" and \"=key=\".
! Move point to the end of the last field."
(let (alist bounds)
! (when (looking-at bibtex-entry-head)
(push (cons "=type=" (match-string bibtex-type-in-head)) alist)
(push (cons "=key=" (match-string bibtex-key-in-head)) alist)
! (goto-char (match-end bibtex-key-in-head))
(while (setq bounds (bibtex-parse-field bibtex-field-name))
(push (cons (bibtex-name-in-field bounds)
(bibtex-text-in-field-bounds bounds))
--- 2722,2748 ----
(let* ((fields-alist (bibtex-parse-entry))
(field-list (bibtex-field-list
(substring (cdr (assoc "=type=" fields-alist))
! 1))) ; don't want @
! (case-fold-search t))
(dolist (field (car field-list))
! (unless (bibtex-assoc-regexp (concat "\\`\\(ALT\\)?" (car field)
"\\'")
! fields-alist)
(bibtex-make-field field)))
(dolist (field (cdr field-list))
! (unless (bibtex-assoc-regexp (concat "\\`\\(OPT\\)?" (car field)
"\\'")
! fields-alist)
(bibtex-make-optional-field field))))))
(defun bibtex-parse-entry ()
"Parse entry at point, return an alist.
The alist elements have the form (FIELD . TEXT), where FIELD can also be
! the special strings \"=type=\" and \"=key=\". For the FIELD \"=key=\"
! TEXT may be nil. Move point to the end of the last field."
(let (alist bounds)
! (when (looking-at bibtex-entry-maybe-empty-head)
(push (cons "=type=" (match-string bibtex-type-in-head)) alist)
(push (cons "=key=" (match-string bibtex-key-in-head)) alist)
! (goto-char (match-end 0))
(while (setq bounds (bibtex-parse-field bibtex-field-name))
(push (cons (bibtex-name-in-field bounds)
(bibtex-text-in-field-bounds bounds))
- [Emacs-diffs] Changes to emacs/lisp/textmodes/bibtex.el [lexbind],
Miles Bader <=