summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCarsten Dominik <dominik@science.uva.nl>2005-05-18 11:25:03 +0000
committerCarsten Dominik <dominik@science.uva.nl>2005-05-18 11:25:03 +0000
commit3a1e8128491fe4bc238315e5a4a5f8d007754003 (patch)
tree756d152d3618918aae8a5f6c18bade207a34ffc2 /lisp
parent896833d5879f0f163bb3eca70597e04e9d688b1e (diff)
downloademacs-3a1e8128491fe4bc238315e5a4a5f8d007754003.tar.gz
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
for jurabib. * textmodes/reftex.el (featurep): Define aliases for overlay commands, for XEmacs compatibility, and use these aliases in overlay initializations. (reftex-highlight): Use `reftex-move-overlay'. (reftex-unhighlight): Use `reftex-delete-overlay'. (reftex-uniq): Funktion removed. Use `reftex-uniquify' instead. (reftex-access-search-path): Use `reftex-uniquify' instead of `reftex-uniq' * textmodes/reftex-sel.el (reftex-select-unmark): Overlay `before-string' property modification enables for Emacs as well. (reftex-select-item): Use `reftex-delete-overlay'. (reftex-select-mark): Use `reftex-make-overlay' and `reftex-overlay-put'. (reftex-select-unmark): Use `reftex-delete-overlay' and `reftex-overlay-put'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog23
-rw-r--r--lisp/textmodes/reftex-auc.el5
-rw-r--r--lisp/textmodes/reftex-cite.el4
-rw-r--r--lisp/textmodes/reftex-dcr.el5
-rw-r--r--lisp/textmodes/reftex-global.el5
-rw-r--r--lisp/textmodes/reftex-index.el2
-rw-r--r--lisp/textmodes/reftex-parse.el2
-rw-r--r--lisp/textmodes/reftex-ref.el7
-rw-r--r--lisp/textmodes/reftex-sel.el42
-rw-r--r--lisp/textmodes/reftex-toc.el5
-rw-r--r--lisp/textmodes/reftex-vars.el21
-rw-r--r--lisp/textmodes/reftex.el46
12 files changed, 104 insertions, 63 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f7114e4272e..7c6d8a03523 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,26 @@
+
+2005-05-18 Carsten Dominik <dominik@science.uva.nl>
+
+ * textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
+ for jurabib.
+
+ * textmodes/reftex.el (featurep): Define aliases for overlay
+ commands, for XEmacs compatibility, and use these aliases in
+ overlay initializations.
+ (reftex-highlight): Use `reftex-move-overlay'.
+ (reftex-unhighlight): Use `reftex-delete-overlay'.
+ (reftex-uniq): Funktion removed. Use `reftex-uniquify' instead.
+ (reftex-access-search-path): Use `reftex-uniquify' instead of
+ `reftex-uniq'
+
+ * textmodes/reftex-sel.el (reftex-select-unmark): Overlay
+ `before-string' property modification enables for Emacs as well.
+ (reftex-select-item): Use `reftex-delete-overlay'.
+ (reftex-select-mark): Use `reftex-make-overlay' and
+ `reftex-overlay-put'.
+ (reftex-select-unmark): Use `reftex-delete-overlay' and
+ `reftex-overlay-put'.
+
2005-05-18 Lute Kamstra <lute@gnu.org>
* emacs-lisp/lisp.el (check-parens): Fix docstring.
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index 93cd0757b4e..821eb7feca2 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -1,8 +1,9 @@
;;; reftex-auc.el --- RefTeX's interface to AUCTeX
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 3f61e9c94ec..90ab8b7a3af 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -3,7 +3,7 @@
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
@@ -681,7 +681,7 @@ While entering the regexp, completion on knows citation keys is possible.
;; Should we cleanup empty optional arguments?
;; if the first is empty, it can be removed. If the second is empty,
;; it has to go. If there is only a single arg and empty, it can go
- ;; as well.
+ ;; as well.
(when reftex-cite-cleanup-optional-args
(cond
((string-match "\\([a-zA-Z0-9]\\)\\[\\]{" string)
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index e832465cf17..b73c62a9a0a 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -1,8 +1,9 @@
;;; reftex-dcr.el --- viewing cross references and citations with RefTeX
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;;
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index d3ef2dcb788..53cf11c9ca9 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -1,8 +1,9 @@
;;; reftex-global.el --- operations on entire documents with RefTeX
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 8fada9c4930..ff2ea70a011 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -3,7 +3,7 @@
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 3f1ff00494f..0046c1b34b8 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -3,7 +3,7 @@
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;;
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index 6afbb77767c..be6f95d6ebc 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -3,7 +3,7 @@
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
@@ -29,6 +29,7 @@
(eval-when-compile (require 'cl))
(provide 'reftex-ref)
(require 'reftex)
+(require 'reftex-parse)
;;;
(defun reftex-label-location (&optional bound)
@@ -200,13 +201,13 @@ This function is controlled by the settings of reftex-insert-label-flags."
force-prompt)
(while (not valid)
- ;; iterate until we get a legal label
+ ;; iterate until we get a valid label
(setq label (read-string
(if naked "Naked Label: " "Label: ")
default))
- ;; Lets make sure that this is a legal label
+ ;; Lets make sure that this is a valid label
(cond
((string-match (concat "\\`\\(" (regexp-quote prefix)
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 8b0ebb2ca2b..be08f98a847 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -1,8 +1,9 @@
;;; reftex-sel.el --- the selection modes for RefTeX
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2440, 2005
+;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
@@ -418,7 +419,7 @@ During a selection process, these are the local bindings.
(remove-hook 'post-command-hook
'reftex-select-post-command-hook t))
;; Kill the mark overlays
- (mapcar (lambda (c) (delete-overlay (nth 1 c)))
+ (mapcar (lambda (c) (reftex-delete-overlay (nth 1 c)))
reftex-select-marked)))))
(set (make-local-variable 'reftex-last-line)
@@ -604,14 +605,14 @@ Useful for large TOC's."
(setq boe (or (previous-single-property-change (1+ (point)) :data)
(point-min))
eoe (or (next-single-property-change (point) :data) (point-max)))
- (setq ovl (make-overlay boe eoe))
+ (setq ovl (reftex-make-overlay boe eoe))
(push (list data ovl separator) reftex-select-marked)
- (overlay-put ovl 'face reftex-select-mark-face)
- (overlay-put ovl 'before-string
- (if separator
- (format "*%c%d* " separator
- (length reftex-select-marked))
- (format "*%d* " (length reftex-select-marked))))
+ (reftex-overlay-put ovl 'face reftex-select-mark-face)
+ (reftex-overlay-put ovl 'before-string
+ (if separator
+ (format "*%c%d* " separator
+ (length reftex-select-marked))
+ (format "*%d* " (length reftex-select-marked))))
(message "Entry has mark no. %d" (length reftex-select-marked))))
(defun reftex-select-mark-comma ()
@@ -637,19 +638,16 @@ Useful for large TOC's."
sep)
(unless cell
(error "No marked entry at point"))
- (and ovl (delete-overlay ovl))
+ (and ovl (reftex-delete-overlay ovl))
(setq reftex-select-marked (delq cell reftex-select-marked))
- (if (featurep 'xemacs)
- ;; before-string property is broken in Emacs
- (progn
- (setq cnt (1+ (length reftex-select-marked)))
- (mapcar (lambda (c)
- (setq sep (nth 2 c))
- (overlay-put (nth 1 c) 'before-string
- (if sep
- (format "*%c%d* " sep (decf cnt))
- (format "*%d* " (decf cnt)))))
- reftex-select-marked)))
+ (setq cnt (1+ (length reftex-select-marked)))
+ (mapcar (lambda (c)
+ (setq sep (nth 2 c))
+ (reftex-overlay-put (nth 1 c) 'before-string
+ (if sep
+ (format "*%c%d* " sep (decf cnt))
+ (format "*%d* " (decf cnt)))))
+ reftex-select-marked)
(message "Entry no longer marked")))
(defun reftex-select-help ()
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index ed9746f8a69..8ad811391c7 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -1,8 +1,9 @@
;;; reftex-toc.el --- RefTeX's table of contents mode
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index b2ca7bed250..64419678b23 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -3,7 +3,7 @@
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; This file is part of GNU Emacs.
@@ -155,6 +155,21 @@ distribution. Mixed-case symbols are convenience aliases.")
(?f . "\\fullcite{%l}")
(?F . "\\fullocite{%l}")
(?n . "\\nocite{%l}")))
+ (jurabib "The Jurabib package"
+ ((?\C-m . "\\cite{%l}")
+ (?c . "\\cite[][]{%l}")
+ (?t . "\\citet{%l}")
+ (?p . "\\citep{%l}")
+ (?e . "\\citep[e.g.][]{%l}")
+ (?s . "\\citep[see][]{%l}")
+ (?u . "\\fullcite{%l}")
+ (?i . "\\citetitle{%l}")
+ (?a . "\\citeauthor{%l}")
+ (?e . "\\citefield{}{%l}")
+ (?y . "\\citeyear{%l}")
+ (?f . "\\footcite{%l}")
+ (?F . "\\footcite[][]{%l}")
+ (?l . "\\footfullcite{%l}")))
(bibentry "The Bibentry package"
"\\bibentry{%l}")
(harvard "The Harvard package"
@@ -639,7 +654,7 @@ or macro."
"Non-nil means, trust the label prefix when determining label type.
It is customary to use special label prefixes to distinguish different label
types. The label prefixes have no syntactic meaning in LaTeX (unless
-special packages like fancyref) are being used. RefTeX can and by
+special packages like fancyref are being used). RefTeX can and by
default does parse around each label to detect the correct label type,
but this process can be slow when a document contains thousands of
labels. If you use label prefixes consistently, you may speed up
@@ -1529,7 +1544,7 @@ TYPE: File type like \"bib\" or \"tex\".
DEF-EXT: The default extension for that file type, like \".tex\" or \".bib\".
OTHER-EXT: Any number of other valid extensions for this file type.
-When a files is searched and it does not have any of the valid extensions,
+When a files is searched and it does not have any of the legal extensions,
we try the default extension first, and then the naked file name.
If you are using AUCTeX, you also need to add new extensions to
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 865217dab08..521062c556f 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -3,7 +3,7 @@
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.26
+;; Version: 4.28
;; Keywords: tex
;; This file is part of GNU Emacs.
@@ -301,7 +301,7 @@
;;; Define the formal stuff for a minor mode named RefTeX.
;;;
-(defconst reftex-version "RefTeX version 4.26"
+(defconst reftex-version "RefTeX version 4.28"
"Version string for RefTeX.")
(defvar reftex-mode nil
@@ -1501,7 +1501,7 @@ When DIE is non-nil, throw an error if file not found."
(when (null (get pathvar 'status))
;; Get basic path
(set pathvar
- (reftex-uniq
+ (reftex-uniquify
(reftex-parse-colon-path
(mapconcat
(lambda(x)
@@ -1606,15 +1606,6 @@ When DIE is non-nil, throw an error if file not found."
(push dir path1)))
path1))
-(defun reftex-uniq (list)
- (let (new)
- (while list
- (or (member (car list) new)
- (push (car list) new))
- (pop list))
- (nreverse new)))
-
-
;;; =========================================================================
;;;
;;; Parser functions
@@ -2145,7 +2136,7 @@ Works on both Emacs and XEmacs."
(nreverse rtn)))
(defun reftex-uniquify (list)
- ;; Return a list of all elements in LIST, but each only once
+ ;; Return a list of all elements in LIST, but each only once, keeping order
(let (new elm)
(while list
(setq elm (pop list))
@@ -2342,31 +2333,40 @@ IGNORE-WORDS List of words which should be removed from the string."
(if (find-face face) (throw 'exit face))
(if (facep face) (throw 'exit face)))))))
-;; Highlighting uses overlays. For XEmacs, we need the emulation.
-(if (featurep 'xemacs) (require 'overlay))
+;; Highlighting uses overlays. For XEmacs, we use extends.
+(if (featurep 'xemacs)
+ (progn
+ (defalias 'reftex-make-overlay 'make-extent)
+ (defalias 'reftex-overlay-put 'set-extent-property)
+ (defalias 'reftex-move-overlay 'set-extent-endpoints)
+ (defalias 'reftex-delete-overlay 'detach-extent))
+ (defalias 'reftex-make-overlay 'make-overlay)
+ (defalias 'reftex-overlay-put 'overlay-put)
+ (defalias 'reftex-move-overlay 'move-overlay)
+ (defalias 'reftex-delete-overlay 'delete-overlay))
;; We keep a vector with several different overlays to do our highlighting.
(defvar reftex-highlight-overlays [nil nil nil])
;; Initialize the overlays
-(aset reftex-highlight-overlays 0 (make-overlay 1 1))
-(overlay-put (aref reftex-highlight-overlays 0)
+(aset reftex-highlight-overlays 0 (reftex-make-overlay 1 1))
+(reftex-overlay-put (aref reftex-highlight-overlays 0)
'face 'highlight)
-(aset reftex-highlight-overlays 1 (make-overlay 1 1))
-(overlay-put (aref reftex-highlight-overlays 1)
+(aset reftex-highlight-overlays 1 (reftex-make-overlay 1 1))
+(reftex-overlay-put (aref reftex-highlight-overlays 1)
'face reftex-cursor-selected-face)
-(aset reftex-highlight-overlays 2 (make-overlay 1 1))
-(overlay-put (aref reftex-highlight-overlays 2)
+(aset reftex-highlight-overlays 2 (reftex-make-overlay 1 1))
+(reftex-overlay-put (aref reftex-highlight-overlays 2)
'face reftex-cursor-selected-face)
;; Two functions for activating and deactivation highlight overlays
(defun reftex-highlight (index begin end &optional buffer)
"Highlight a region with overlay INDEX."
- (move-overlay (aref reftex-highlight-overlays index)
+ (reftex-move-overlay (aref reftex-highlight-overlays index)
begin end (or buffer (current-buffer))))
(defun reftex-unhighlight (index)
"Detach overlay INDEX."
- (delete-overlay (aref reftex-highlight-overlays index)))
+ (reftex-delete-overlay (aref reftex-highlight-overlays index)))
(defun reftex-highlight-shall-die ()
;; Function used in pre-command-hook to remove highlights.