[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 07:11:03 -0400 |
Index: emacs/lisp/textmodes/bibtex.el
diff -c emacs/lisp/textmodes/bibtex.el:1.69.2.4
emacs/lisp/textmodes/bibtex.el:1.69.2.5
*** emacs/lisp/textmodes/bibtex.el:1.69.2.4 Tue May 11 02:21:07 2004
--- emacs/lisp/textmodes/bibtex.el Tue Jul 6 09:23:48 2004
***************
*** 1502,1508 ****
(save-excursion
(if (or (and (not bibtex-sort-ignore-string-entries)
(string-equal "string" (downcase entry-type)))
! (assoc-ignore-case entry-type bibtex-entry-field-alist))
(funcall fun key beg end)))
(goto-char end)))))
--- 1502,1508 ----
(save-excursion
(if (or (and (not bibtex-sort-ignore-string-entries)
(string-equal "string" (downcase entry-type)))
! (assoc-string entry-type bibtex-entry-field-alist t))
(funcall fun key beg end)))
(goto-char end)))))
***************
*** 1771,1779 ****
(re-search-forward bibtex-entry-type)
(let ((beg-type (1+ (match-beginning 0)))
(end-type (match-end 0)))
! (setq entry-list (assoc-ignore-case (buffer-substring-no-properties
! beg-type end-type)
! bibtex-entry-field-alist))
;; unify case of entry name
(when (memq 'unify-case format)
--- 1771,1780 ----
(re-search-forward bibtex-entry-type)
(let ((beg-type (1+ (match-beginning 0)))
(end-type (match-end 0)))
! (setq entry-list (assoc-string (buffer-substring-no-properties
! beg-type end-type)
! bibtex-entry-field-alist
! t))
;; unify case of entry name
(when (memq 'unify-case format)
***************
*** 1846,1853 ****
(if (memq 'opts-or-alts format)
(cond ((and empty-field
(or opt-alt
! (let ((field (assoc-ignore-case
! field-name req-field-list)))
(or (not field) ; OPT field
(nth 3 field))))) ; ALT field
;; Either it is an empty ALT field. Then we have
checked
--- 1847,1854 ----
(if (memq 'opts-or-alts format)
(cond ((and empty-field
(or opt-alt
! (let ((field (assoc-string
! field-name req-field-list t)))
(or (not field) ; OPT field
(nth 3 field))))) ; ALT field
;; Either it is an empty ALT field. Then we have
checked
***************
*** 1918,1932 ****
;; if empty field, complain
(if (and empty-field
(memq 'required-fields format)
! (assoc-ignore-case field-name req-field-list))
(error "Mandatory field `%s' is empty" field-name))
;; unify case of field name
(if (memq 'unify-case format)
! (let ((fname (car (assoc-ignore-case
! field-name (append (nth 0 (nth 1
entry-list))
! (nth 1 (nth 1
entry-list))
!
bibtex-user-optional-fields)))))
(if fname
(progn
(delete-region beg-name end-name)
--- 1919,1935 ----
;; if empty field, complain
(if (and empty-field
(memq 'required-fields format)
! (assoc-string field-name req-field-list t))
(error "Mandatory field `%s' is empty" field-name))
;; unify case of field name
(if (memq 'unify-case format)
! (let ((fname (car (assoc-string
! field-name
! (append (nth 0 (nth 1 entry-list))
! (nth 1 (nth 1 entry-list))
! bibtex-user-optional-fields)
! t))))
(if fname
(progn
(delete-region beg-name end-name)
***************
*** 2258,2265 ****
;; This is a crossref.
(buffer-substring-no-properties
(1+ (match-beginning 3)) (1- (match-end
3))))
! ((assoc-ignore-case (bibtex-type-in-head)
!
bibtex-entry-field-alist)
;; This is an entry.
(match-string-no-properties
bibtex-key-in-head)))))
(if (and (stringp key)
--- 2261,2268 ----
;; This is a crossref.
(buffer-substring-no-properties
(1+ (match-beginning 3)) (1- (match-end
3))))
! ((assoc-string (bibtex-type-in-head)
! bibtex-entry-field-alist t)
;; This is an entry.
(match-string-no-properties
bibtex-key-in-head)))))
(if (and (stringp key)
***************
*** 2314,2320 ****
;; user has aborted by typing a key --> return `aborted'
(throw 'userkey 'aborted))
(setq key (bibtex-reference-key-in-string bounds))
! (if (not (assoc-ignore-case key strings))
(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-string key strings t))
(push (cons key (bibtex-text-in-string bounds t))
strings))
(goto-char (bibtex-end-of-text-in-string bounds)))
***************
*** 2654,2660 ****
More specifically, the return value is a cons pair (REQUIRED . OPTIONAL),
where REQUIRED and OPTIONAL are lists of the required and optional field
names for ENTRY-TYPE according to `bibtex-entry-field-alist'."
! (let ((e (assoc-ignore-case entry-type bibtex-entry-field-alist))
required optional)
(unless e
(error "Bibtex entry type %s not defined" entry-type))
--- 2657,2663 ----
More specifically, the return value is a cons pair (REQUIRED . OPTIONAL),
where REQUIRED and OPTIONAL are lists of the required and optional field
names for ENTRY-TYPE according to `bibtex-entry-field-alist'."
! (let ((e (assoc-string entry-type bibtex-entry-field-alist t))
required optional)
(unless e
(error "Bibtex entry type %s not defined" entry-type))
***************
*** 2721,2730 ****
(substring (cdr (assoc "=type=" fields-alist))
1)))) ; don't want @
(dolist (field (car field-list))
! (unless (assoc-ignore-case (car field) fields-alist)
(bibtex-make-field field)))
(dolist (field (cdr field-list))
! (unless (assoc-ignore-case (car field) fields-alist)
(bibtex-make-optional-field field))))))
(defun bibtex-parse-entry ()
--- 2724,2733 ----
(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 ()
***************
*** 2792,2798 ****
(let* ((name (buffer-substring
(if (looking-at "ALT\\|OPT") (match-end 0) (point))
(bibtex-end-of-name-in-field bounds)))
! (text (assoc-ignore-case name other)))
(goto-char (bibtex-start-of-text-in-field bounds))
(if (not (and (looking-at bibtex-empty-field-re) text))
(goto-char (bibtex-end-of-field bounds))
--- 2795,2801 ----
(let* ((name (buffer-substring
(if (looking-at "ALT\\|OPT") (match-end 0) (point))
(bibtex-end-of-name-in-field bounds)))
! (text (assoc-string name other t)))
(goto-char (bibtex-start-of-text-in-field bounds))
(if (not (and (looking-at bibtex-empty-field-re) text))
(goto-char (bibtex-end-of-field bounds))
***************
*** 2825,2833 ****
(field-list (bibtex-field-list (progn (re-search-backward
bibtex-entry-maybe-empty-head nil t)
(bibtex-type-in-head))))
! (comment (assoc-ignore-case field-name
! (append (car field-list)
! (cdr field-list)))))
(if comment
(message (nth 1 comment))
(message "No comment available")))))
--- 2828,2837 ----
(field-list (bibtex-field-list (progn (re-search-backward
bibtex-entry-maybe-empty-head nil t)
(bibtex-type-in-head))))
! (comment (assoc-string field-name
! (append (car field-list)
! (cdr field-list))
! t)))
(if comment
(message (nth 1 comment))
(message "No comment available")))))
***************
*** 3235,3242 ****
(let* ((entry-list (progn
(goto-char beg)
(bibtex-search-entry nil end)
! (assoc-ignore-case (bibtex-type-in-head)
!
bibtex-entry-field-alist)))
(req (copy-sequence (elt (elt entry-list 1) 0)))
(creq (copy-sequence (elt (elt entry-list 2) 0)))
crossref-there bounds)
--- 3239,3246 ----
(let* ((entry-list (progn
(goto-char beg)
(bibtex-search-entry nil end)
! (assoc-string (bibtex-type-in-head)
! bibtex-entry-field-alist
t)))
(req (copy-sequence (elt (elt entry-list 1) 0)))
(creq (copy-sequence (elt (elt entry-list 2) 0)))
crossref-there bounds)
***************
*** 3252,3259 ****
(push (list (bibtex-current-line)
"Questionable month field")
error-list))
! (setq req (delete (assoc-ignore-case field-name req)
req)
! creq (delete (assoc-ignore-case field-name creq)
creq))
(if (equal field-name "crossref")
(setq crossref-there t))))
(if crossref-there
--- 3256,3263 ----
(push (list (bibtex-current-line)
"Questionable month field")
error-list))
! (setq req (delete (assoc-string field-name req t) req)
! creq (delete (assoc-string field-name creq t)
creq))
(if (equal field-name "crossref")
(setq crossref-there t))))
(if crossref-there