(put 'reftex-mode :menu-tag "RefTeX Mode")
;;;###autoload
(define-minor-mode reftex-mode
- "Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX.
+ "Toggle RefTeX mode.
+With a prefix argument ARG, enable RefTeX mode if ARG is
+positive, and disable it otherwise. If called from Lisp, enable
+the mode if ARG is omitted or nil.
+
+RefTeX mode is a buffer-local minor mode with distinct support
+for \\label, \\ref and \\cite in LaTeX.
\\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing
capabilities is available with `\\[reftex-toc]'.
"Save RefTeX's parse file for this buffer if the information has changed."
;; Save the parsing information if it was modified.
;; This function should be installed in `kill-buffer-hook'.
- ;; We are careful to make sure nothing goes wring in this function.
+ ;; We are careful to make sure nothing goes wrong in this function.
(when (and (boundp 'reftex-mode) reftex-mode
(boundp 'reftex-save-parse-info) reftex-save-parse-info
(boundp 'reftex-docstruct-symbol) reftex-docstruct-symbol
;;; (while all
;;; (when (and (eq (car (car all)) 'bof)
;;; (not (file-regular-p (nth 1 (car all)))))
-;;; (message "File %s in saved parse info not avalable" (cdr (car all)))
+;;; (message "File %s in saved parse info not available" (cdr (car all)))
;;; (error "File not found"))
;;; (setq all (cdr all))))
)
;;; Finding files
(defun reftex-locate-file (file type master-dir &optional die)
- "Find FILE of type TYPE in MASTER-DIR or on the path associcted with TYPE.
+ "Find FILE of type TYPE in MASTER-DIR or on the path associated with TYPE.
If the file does not have any of the valid extensions for TYPE,
try first the default extension and only then the naked file name.
When DIE is non-nil, throw an error if file not found."
(defvar font-lock-defaults-computed)
(defun reftex-fontify-select-label-buffer (parent-buffer)
;; Fontify the `*RefTeX Select*' buffer. Buffer is temporarily renamed to
- ;; start with none-SPC char, beacuse Font-Lock otherwise refuses operation.
+ ;; start with none-SPC char, because Font-Lock otherwise refuses operation.
(run-hook-with-args 'reftex-pre-refontification-functions
parent-buffer 'reftex-ref)
(let* ((oldname (buffer-name))
(define-key reftex-mode-map
reftex-extra-bindings-prefix
reftex-extra-bindings-map))
-
+
;;; =========================================================================
;;;
;;; Install the kill-buffer and kill-emacs hooks ------------------------------
(add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook)
-(add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook))
;;; Run Hook ------------------------------------------------------------------