[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-cite.el
From: |
Carsten Dominik |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-cite.el |
Date: |
Tue, 20 Aug 2002 06:41:03 -0400 |
Index: emacs/lisp/textmodes/reftex-cite.el
diff -c emacs/lisp/textmodes/reftex-cite.el:1.16
emacs/lisp/textmodes/reftex-cite.el:1.17
*** emacs/lisp/textmodes/reftex-cite.el:1.16 Thu Jul 25 03:03:41 2002
--- emacs/lisp/textmodes/reftex-cite.el Tue Aug 20 06:41:00 2002
***************
*** 74,79 ****
--- 74,99 ----
reftex-default-bibliography))
(get 'reftex-default-bibliography :reftex-expanded))
+ (defun reftex-bib-or-thebib ()
+ ;; Tests if BibTeX or \begin{tehbibliography} should be used for the
+ ;; citation
+ ;; Find the bof of the current file
+ (let* ((docstruct (symbol-value reftex-docstruct-symbol))
+ (rest (or (member (list 'bof (buffer-file-name)) docstruct)
+ docstruct))
+ (bib (assq 'bib rest))
+ (thebib (assq 'thebib rest))
+ (bibmem (memq bib rest))
+ (thebibmem (memq thebib rest)))
+ (when (not (or thebib bib))
+ (setq bib (assq 'bib docstruct)
+ thebib (assq 'thebib docstruct)
+ bibmem (memq bib docstruct)
+ thebibmem (memq thebib docstruct)))
+ (if (> (length bibmem) (length thebibmem))
+ (if bib 'bib nil)
+ (if thebib 'thebib nil))))
+
(defun reftex-get-bibfile-list ()
;; Return list of bibfiles for current document.
;; When using the chapterbib or bibunits package you should either
***************
*** 736,752 ****
(defun reftex-offer-bib-menu ()
;; Offer bib menu and return list of selected items
! (let (found-list rtn key data selected-entries)
(while
(not
(catch 'done
;; Scan bibtex files
(setq found-list
(cond
! ((assq 'bib (symbol-value reftex-docstruct-symbol))
;; using BibTeX database files.
(reftex-extract-bib-entries (reftex-get-bibfile-list)))
! ((assq 'thebib (symbol-value reftex-docstruct-symbol))
;; using thebibliography environment.
(reftex-extract-bib-entries-from-thebibliography
(reftex-uniquify
--- 756,775 ----
(defun reftex-offer-bib-menu ()
;; Offer bib menu and return list of selected items
! (let ((bibtype (reftex-bib-or-thebib))
! found-list rtn key data selected-entries)
(while
(not
(catch 'done
;; Scan bibtex files
(setq found-list
(cond
! ((eq bibtype 'bib)
! ; ((assq 'bib (symbol-value reftex-docstruct-symbol))
;; using BibTeX database files.
(reftex-extract-bib-entries (reftex-get-bibfile-list)))
! ((eq bibtype 'thebib)
! ; ((assq 'thebib (symbol-value reftex-docstruct-symbol))
;; using thebibliography environment.
(reftex-extract-bib-entries-from-thebibliography
(reftex-uniquify
***************
*** 987,1001 ****
;; recommended for follow mode. It works OK for individual lookups.
(let ((win (selected-window))
(key (reftex-get-bib-field "&key" data))
! bibfile-list item)
(catch 'exit
(save-excursion
(set-buffer reftex-call-back-to-this-buffer)
(cond
! ((assq 'bib (symbol-value reftex-docstruct-symbol))
(setq bibfile-list (reftex-get-bibfile-list)))
! ((assq 'thebib (symbol-value reftex-docstruct-symbol))
(setq bibfile-list
(reftex-uniquify
(mapcar 'cdr
--- 1010,1027 ----
;; recommended for follow mode. It works OK for individual lookups.
(let ((win (selected-window))
(key (reftex-get-bib-field "&key" data))
! bibfile-list item bibtype)
(catch 'exit
(save-excursion
(set-buffer reftex-call-back-to-this-buffer)
+ (setq bibtype (reftex-bib-or-thebib))
(cond
! ((eq bibtype 'bib)
! ; ((assq 'bib (symbol-value reftex-docstruct-symbol))
(setq bibfile-list (reftex-get-bibfile-list)))
! ((eq bibtype 'thebib)
! ; ((assq 'thebib (symbol-value reftex-docstruct-symbol))
(setq bibfile-list
(reftex-uniquify
(mapcar 'cdr
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-cite.el,
Carsten Dominik <=