aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2002-08-20 10:42:52 +0000
committerCarsten Dominik2002-08-20 10:42:52 +0000
commit20cd3579bd4252ccb091ce0b73c3fa6c8806fbd7 (patch)
tree7bdbae404ace7b8588e972df3ddc89549ae27849
parentbcaf8c79fbbde692f256fa2aef2dc2a78f25a44b (diff)
downloademacs-20cd3579bd4252ccb091ce0b73c3fa6c8806fbd7.tar.gz
emacs-20cd3579bd4252ccb091ce0b73c3fa6c8806fbd7.zip
Update to RefTeX 4.18
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/textmodes/reftex-cite.el38
-rw-r--r--lisp/textmodes/reftex-dcr.el9
-rw-r--r--lisp/textmodes/reftex.el2
4 files changed, 53 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c95de2c48ec..82540e6539b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12002-08-20 Carsten Dominik <dominik@astro.uva.nl>
2
3 * textfiles/reftex-cite.el (reftex-bib-or-thebib): New function
4 which determines on a per-file-basis if BibTeX is being used
5 locally for citations.
6 (reftex-offer-bib-menu): Use `reftex-bib-or-thebib' for better
7 cooperation with chapterbib.
8 (reftex-bibtex-selection-callback): Use `reftex-bib-or-thebib' for
9 better cooperation with chapterbib.
10
11 * textfiles/reftex-dcr.el (reftex-view-cr-cite): Use
12 `reftex-bib-or-thebib' for better cooperation with chapterbib.
13
14
12002-08-20 Kim F. Storm <storm@cua.dk> 152002-08-20 Kim F. Storm <storm@cua.dk>
2 16
3 * kmacro.el: Major rework based on discussions with RMS. 17 * kmacro.el: Major rework based on discussions with RMS.
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 39d8f26a9a6..d4d5b508eef 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -74,6 +74,26 @@
74 reftex-default-bibliography)) 74 reftex-default-bibliography))
75 (get 'reftex-default-bibliography :reftex-expanded)) 75 (get 'reftex-default-bibliography :reftex-expanded))
76 76
77(defun reftex-bib-or-thebib ()
78 ;; Tests if BibTeX or \begin{tehbibliography} should be used for the
79 ;; citation
80 ;; Find the bof of the current file
81 (let* ((docstruct (symbol-value reftex-docstruct-symbol))
82 (rest (or (member (list 'bof (buffer-file-name)) docstruct)
83 docstruct))
84 (bib (assq 'bib rest))
85 (thebib (assq 'thebib rest))
86 (bibmem (memq bib rest))
87 (thebibmem (memq thebib rest)))
88 (when (not (or thebib bib))
89 (setq bib (assq 'bib docstruct)
90 thebib (assq 'thebib docstruct)
91 bibmem (memq bib docstruct)
92 thebibmem (memq thebib docstruct)))
93 (if (> (length bibmem) (length thebibmem))
94 (if bib 'bib nil)
95 (if thebib 'thebib nil))))
96
77(defun reftex-get-bibfile-list () 97(defun reftex-get-bibfile-list ()
78 ;; Return list of bibfiles for current document. 98 ;; Return list of bibfiles for current document.
79 ;; When using the chapterbib or bibunits package you should either 99 ;; When using the chapterbib or bibunits package you should either
@@ -736,17 +756,20 @@ While entering the regexp, completion on knows citation keys is possible.
736(defun reftex-offer-bib-menu () 756(defun reftex-offer-bib-menu ()
737 ;; Offer bib menu and return list of selected items 757 ;; Offer bib menu and return list of selected items
738 758
739 (let (found-list rtn key data selected-entries) 759 (let ((bibtype (reftex-bib-or-thebib))
760 found-list rtn key data selected-entries)
740 (while 761 (while
741 (not 762 (not
742 (catch 'done 763 (catch 'done
743 ;; Scan bibtex files 764 ;; Scan bibtex files
744 (setq found-list 765 (setq found-list
745 (cond 766 (cond
746 ((assq 'bib (symbol-value reftex-docstruct-symbol)) 767 ((eq bibtype 'bib)
768; ((assq 'bib (symbol-value reftex-docstruct-symbol))
747 ;; using BibTeX database files. 769 ;; using BibTeX database files.
748 (reftex-extract-bib-entries (reftex-get-bibfile-list))) 770 (reftex-extract-bib-entries (reftex-get-bibfile-list)))
749 ((assq 'thebib (symbol-value reftex-docstruct-symbol)) 771 ((eq bibtype 'thebib)
772; ((assq 'thebib (symbol-value reftex-docstruct-symbol))
750 ;; using thebibliography environment. 773 ;; using thebibliography environment.
751 (reftex-extract-bib-entries-from-thebibliography 774 (reftex-extract-bib-entries-from-thebibliography
752 (reftex-uniquify 775 (reftex-uniquify
@@ -987,15 +1010,18 @@ While entering the regexp, completion on knows citation keys is possible.
987 ;; recommended for follow mode. It works OK for individual lookups. 1010 ;; recommended for follow mode. It works OK for individual lookups.
988 (let ((win (selected-window)) 1011 (let ((win (selected-window))
989 (key (reftex-get-bib-field "&key" data)) 1012 (key (reftex-get-bib-field "&key" data))
990 bibfile-list item) 1013 bibfile-list item bibtype)
991 1014
992 (catch 'exit 1015 (catch 'exit
993 (save-excursion 1016 (save-excursion
994 (set-buffer reftex-call-back-to-this-buffer) 1017 (set-buffer reftex-call-back-to-this-buffer)
1018 (setq bibtype (reftex-bib-or-thebib))
995 (cond 1019 (cond
996 ((assq 'bib (symbol-value reftex-docstruct-symbol)) 1020 ((eq bibtype 'bib)
1021; ((assq 'bib (symbol-value reftex-docstruct-symbol))
997 (setq bibfile-list (reftex-get-bibfile-list))) 1022 (setq bibfile-list (reftex-get-bibfile-list)))
998 ((assq 'thebib (symbol-value reftex-docstruct-symbol)) 1023 ((eq bibtype 'thebib)
1024; ((assq 'thebib (symbol-value reftex-docstruct-symbol))
999 (setq bibfile-list 1025 (setq bibfile-list
1000 (reftex-uniquify 1026 (reftex-uniquify
1001 (mapcar 'cdr 1027 (mapcar 'cdr
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index d7419ad49cc..6f9577473d4 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -116,13 +116,16 @@ to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'."
116 (put 'reftex-auto-view-crossref 'last-window-conf 116 (put 'reftex-auto-view-crossref 'last-window-conf
117 (current-window-configuration))) 117 (current-window-configuration)))
118 118
119 (let (files size item (pos (point)) (win (selected-window)) pop-win) 119 (let (files size item (pos (point)) (win (selected-window)) pop-win
120 (bibtype (reftex-bib-or-thebib)))
120 ;; Find the citation mode and the file list 121 ;; Find the citation mode and the file list
121 (cond 122 (cond
122 ((assq 'bib (symbol-value reftex-docstruct-symbol)) 123; ((assq 'bib (symbol-value reftex-docstruct-symbol))
124 ((eq bibtype 'bib)
123 (setq item nil 125 (setq item nil
124 files (reftex-get-bibfile-list))) 126 files (reftex-get-bibfile-list)))
125 ((assq 'thebib (symbol-value reftex-docstruct-symbol)) 127; ((assq 'thebib (symbol-value reftex-docstruct-symbol))
128 ((eq bibtype 'thebib)
126 (setq item t 129 (setq item t
127 files (reftex-uniquify 130 files (reftex-uniquify
128 (mapcar 'cdr 131 (mapcar 'cdr
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index c99551fbad2..877352d4f2e 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1665,7 +1665,7 @@ When DIE is non-nil, throw an error if file not found."
1665(autoload 'reftex-citation "reftex-cite" 1665(autoload 'reftex-citation "reftex-cite"
1666 "Make a citation using BibTeX database files." t) 1666 "Make a citation using BibTeX database files." t)
1667(autoload 'reftex-default-bibliography "reftex-cite") 1667(autoload 'reftex-default-bibliography "reftex-cite")
1668 1668(autoload 'reftex-bib-or-thebib "reftex-cite")
1669 1669
1670;;; ========================================================================= 1670;;; =========================================================================
1671;;; 1671;;;