Mercurial > emacs
changeset 62467:35f6599373fc
* 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'.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Wed, 18 May 2005 11:23:26 +0000 |
parents | c23ef4f5daa9 |
children | 2867884418c2 |
files | lisp/textmodes/reftex-auc.el lisp/textmodes/reftex-cite.el lisp/textmodes/reftex-dcr.el lisp/textmodes/reftex-global.el lisp/textmodes/reftex-index.el lisp/textmodes/reftex-parse.el lisp/textmodes/reftex-ref.el lisp/textmodes/reftex-sel.el lisp/textmodes/reftex-toc.el lisp/textmodes/reftex-vars.el lisp/textmodes/reftex.el |
diffstat | 11 files changed, 81 insertions(+), 63 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/textmodes/reftex-auc.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-auc.el Wed May 18 11:23:26 2005 +0000 @@ -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.
--- a/lisp/textmodes/reftex-cite.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-cite.el Wed May 18 11:23:26 2005 +0000 @@ -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 @@ ;; 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)
--- a/lisp/textmodes/reftex-dcr.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-dcr.el Wed May 18 11:23:26 2005 +0000 @@ -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.
--- a/lisp/textmodes/reftex-global.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-global.el Wed May 18 11:23:26 2005 +0000 @@ -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.
--- a/lisp/textmodes/reftex-index.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-index.el Wed May 18 11:23:26 2005 +0000 @@ -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.
--- a/lisp/textmodes/reftex-parse.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-parse.el Wed May 18 11:23:26 2005 +0000 @@ -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.
--- a/lisp/textmodes/reftex-ref.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-ref.el Wed May 18 11:23:26 2005 +0000 @@ -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 @@ 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)
--- a/lisp/textmodes/reftex-sel.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-sel.el Wed May 18 11:23:26 2005 +0000 @@ -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 @@ (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 @@ (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 @@ 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 ()
--- a/lisp/textmodes/reftex-toc.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-toc.el Wed May 18 11:23:26 2005 +0000 @@ -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.
--- a/lisp/textmodes/reftex-vars.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex-vars.el Wed May 18 11:23:26 2005 +0000 @@ -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 @@ (?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 @@ "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 @@ 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
--- a/lisp/textmodes/reftex.el Wed May 18 11:09:16 2005 +0000 +++ b/lisp/textmodes/reftex.el Wed May 18 11:23:26 2005 +0000 @@ -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 (null (get pathvar 'status)) ;; Get basic path (set pathvar - (reftex-uniq + (reftex-uniquify (reftex-parse-colon-path (mapconcat (lambda(x) @@ -1606,15 +1606,6 @@ (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 @@ (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 @@ (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.