(let ((load-path (cons (expand-file-name ".") load-path)))
(load "pcl-cvs" 'noerror)
(load "rcs" 'noerror)
- ;; On 8+3 MS-DOS filesystems, generic-x.el is loaded
- ;; instead of (the missing) generic-sc.el. Since the
- ;; version of Emacs which supports MS-DOS doesn't have
- ;; generic-sc, we simply avoid loading it.
- (or (and (fboundp 'msdos-long-file-names)
- (not (msdos-long-file-names)))
- (load "generic-sc" 'noerror))
;; (load "vc" 'noerror) ; this sometimes causes compiler error
(or (featurep 'ediff-init)
(load "ediff-init.el" nil nil 'nosuffix))
(ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
))
-
-;; GENERIC-SC.el support
-
-(defun generic-sc-get-latest-rev ()
- (cond ((eq sc-mode 'CCASE)
- (eval "main/LATEST"))
- (t (eval ""))))
-
-(defun ediff-generic-sc-internal (rev1 rev2 &optional startup-hooks)
-;; Run Ediff on versions of the current buffer.
-;; If REV2 is "" then compare current buffer with REV1.
-;; If the current buffer is named `F', the version is named `F.~REV~'.
-;; If `F.~REV~' already exists, it is used instead of being re-created.
- (let (rev1buf rev2buf)
- (save-excursion
- (if (or (not rev1) (string= rev1 ""))
- (setq rev1 (generic-sc-get-latest-rev)))
- (sc-visit-previous-revision rev1)
- (setq rev1buf (current-buffer)))
- (save-excursion
- (or (string= rev2 "") ; use current buffer
- (sc-visit-previous-revision rev2))
- (setq rev2buf (current-buffer)))
- (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)))
-
-
;;; Merge with Version Control
(defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev
(ediff-merge-buffers
buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))))
-(defun ediff-generic-sc-merge-internal (rev1 rev2 ancestor-rev
- &optional
- startup-hooks merge-buffer-file)
- ;; If ANCESTOR-REV non-nil, merge with ancestor
- (let (buf1 buf2 ancestor-buf)
- (save-excursion
- (if (string= rev1 "")
- (setq rev1 (generic-sc-get-latest-rev)))
- (sc-visit-previous-revision rev1)
- (setq buf1 (current-buffer)))
- (save-excursion
- (or (string= rev2 "")
- (sc-visit-previous-revision rev2))
- (setq buf2 (current-buffer)))
- (if ancestor-rev
- (save-excursion
- (or (string= ancestor-rev "")
- (sc-visit-previous-revision ancestor-rev))
- (setq ancestor-buf (current-buffer))))
- (if ancestor-rev
- (ediff-merge-buffers-with-ancestor
- buf1 buf2 ancestor-buf
- startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file)
- (ediff-merge-buffers
- buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))))
-
-
-;; PCL-CVS.el support
-
-;; MK: Check. This function doesn't seem to be used any more by pcvs or pcl-cvs
-(defun cvs-run-ediff-on-file-descriptor (tin)
-;; This is a replacement for cvs-emerge-mode
-;; Runs after cvs-update.
-;; Ediff-merge appropriate revisions of the selected file.
- (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
- (type (cvs-fileinfo->type fileinfo))
- (tmp-file
- (cvs-retrieve-revision-to-tmpfile fileinfo))
- (default-directory
- (file-name-as-directory (cvs-fileinfo->dir fileinfo)))
- ancestor-file)
-
- (or (memq type '(MERGED CONFLICT MODIFIED))
- (error
- "Can only merge `Modified', `Merged' or `Conflict' files"))
-
- (cond ((memq type '(MERGED CONFLICT))
- (setq ancestor-file
- (cvs-retrieve-revision-to-tmpfile
- fileinfo
- ;; revision
- (cvs-fileinfo->base-revision fileinfo)))
- (ediff-merge-buffers-with-ancestor
- (find-file-noselect tmp-file)
- (find-file-noselect (cvs-fileinfo->backup-file fileinfo))
- (find-file-noselect ancestor-file)
- nil ; startup-hooks
- 'ediff-merge-revisions-with-ancestor))
- ((eq type 'MODIFIED)
- (ediff-buffers
- (find-file-noselect tmp-file)
- (if (featurep 'xemacs)
- ;; XEmacs doesn't seem to have cvs-fileinfo->full-name
- (find-file-noselect (cvs-fileinfo->full-path fileinfo))
- (find-file-noselect (cvs-fileinfo->full-name fileinfo)))
- nil ; startup-hooks
- 'ediff-revisions)))
- (if (stringp tmp-file) (ediff-delete-version-file tmp-file))
- (if (stringp ancestor-file) (ediff-delete-version-file ancestor-file))))
-
;; delete version file on exit unless ediff-keep-tmp-versions is true
(defun ediff-delete-version-file (file)
(defvar reftex-toc-auto-recenter-timer nil
"The idle timer used to recenter the toc window.")
+;;; =========================================================================
+;;;
+;;; Parser functions
+
+(autoload 'reftex-parse-one "reftex-parse"
+ "Re-parse this file." t)
+(autoload 'reftex-parse-all "reftex-parse"
+ "Re-parse entire document." t)
+(autoload 'reftex-do-parse "reftex-parse")
+(autoload 'reftex-where-am-I "reftex-parse")
+(autoload 'reftex-init-section-numbers "reftex-parse")
+(autoload 'reftex-section-info "reftex-parse")
+(autoload 'reftex-section-number "reftex-parse")
+(autoload 'reftex-what-macro "reftex-parse")
+(autoload 'reftex-what-macro-safe "reftex-parse")
+(autoload 'reftex-index-info "reftex-parse")
+(autoload 'reftex-index-info-safe "reftex-parse")
+(autoload 'reftex-short-context "reftex-parse")
+(autoload 'reftex-what-environment "reftex-parse")
+(autoload 'reftex-what-special-env "reftex-parse")
+(autoload 'reftex-move-over-touching-args "reftex-parse")
+(autoload 'reftex-notice-new "reftex-parse")
+(autoload 'reftex-nth-arg "reftex-parse")
+(autoload 'reftex-locate-bibliography-files "reftex-parse")
+(autoload 'reftex-ensure-index-support "reftex-parse")
+(autoload 'reftex-everything-regexp "reftex-parse")
+
+
+;;; =========================================================================
+;;;
+;;; Labels and References
+
+(autoload 'reftex-label-location "reftex-ref")
+(autoload 'reftex-label-info-update "reftex-ref")
+(autoload 'reftex-label-info "reftex-ref")
+(autoload 'reftex-label "reftex-ref"
+ "Insert a unique label." t)
+(autoload 'reftex-reference "reftex-ref"
+ "Make a LaTeX reference." t)
+(autoload 'reftex-varioref-vref "reftex-ref"
+ "Make a varioref reference." t)
+(autoload 'reftex-fancyref-fref "reftex-ref"
+ "Make a fancyref \\fref reference." t)
+(autoload 'reftex-fancyref-Fref "reftex-ref"
+ "Make a fancyref \\Fref reference." t)
+(autoload 'reftex-show-label-location "reftex-ref")
+(autoload 'reftex-query-label-type "reftex-ref")
+(autoload 'reftex-goto-label "reftex-ref"
+ "Prompt for label name and go to that location." t)
+
+;;; =========================================================================
+;;;
+;;; Table of contents
+
+(autoload 'reftex-toc "reftex-toc"
+ "Show the table of contents for the current document." t)
+(autoload 'reftex-toc-recenter "reftex-toc"
+ "Display the TOC window and highlight line corresponding to current position." t)
+(autoload 'reftex-toggle-auto-toc-recenter "reftex-toc"
+ "Toggle automatic recentering of TOC window." t)
+
+;;; =========================================================================
+;;;
+;;; BibTeX citations.
+
+(autoload 'reftex-citep "reftex-cite")
+(autoload 'reftex-citet "reftex-cite")
+(autoload 'reftex-make-cite-echo-string "reftex-cite")
+(autoload 'reftex-get-bibfile-list "reftex-cite")
+(autoload 'reftex-pop-to-bibtex-entry "reftex-cite")
+(autoload 'reftex-end-of-bib-entry "reftex-cite")
+(autoload 'reftex-parse-bibtex-entry "reftex-cite")
+(autoload 'reftex-citation "reftex-cite"
+ "Make a citation using BibTeX database files." t)
+(autoload 'reftex-default-bibliography "reftex-cite")
+(autoload 'reftex-bib-or-thebib "reftex-cite")
+(autoload 'reftex-create-bibtex-file "reftex-cite")
+
+;;; =========================================================================
+;;;
+;;; Selection
+
+(autoload 'reftex-select-label-mode "reftex-sel")
+(autoload 'reftex-select-bib-mode "reftex-sel")
+(autoload 'reftex-find-start-point "reftex-sel")
+(autoload 'reftex-insert-docstruct "reftex-sel")
+(autoload 'reftex-get-offset "reftex-sel")
+(autoload 'reftex-select-item "reftex-sel")
+
+
+;;; =========================================================================
+;;;
+;;; Index support
+
+(autoload 'reftex-index "reftex-index"
+ "Query for an index macro and insert it along with its argments." t)
+(autoload 'reftex-index-selection-or-word "reftex-index"
+ "Put selection or the word near point into the default index macro." t)
+(autoload 'reftex-index-phrase-selection-or-word "reftex-index"
+ "Put selection or the word near point into Index Phrases File." t)
+(autoload 'reftex-display-index "reftex-index"
+ "Display a buffer with an index compiled from the current document." t)
+(autoload 'reftex-index-visit-phrases-buffer "reftex-index"
+ "Visit the Index Phrases File." t)
+(autoload 'reftex-index-phrases-mode "reftex-index"
+ "Major mode for managing the Index phrases of a LaTeX document." t)
+(autoload 'reftex-index-complete-tag "reftex-index")
+(autoload 'reftex-index-complete-key "reftex-index")
+(autoload 'reftex-index-show-entry "reftex-index")
+(autoload 'reftex-index-select-tag "reftex-index")
+
+
+;;; =========================================================================
+;;;
+;;; View cross references
+
+(autoload 'reftex-view-crossref "reftex-dcr"
+ "View cross reference of \\ref or \\cite macro at point." t)
+(autoload 'reftex-mouse-view-crossref "reftex-dcr"
+ "View cross reference of \\ref or \\cite macro where you click." t)
+(autoload 'reftex-toggle-auto-view-crossref "reftex-dcr")
+(autoload 'reftex-view-crossref-from-bibtex "reftex-dcr"
+ "View location in a LaTeX document which cites the BibTeX entry at point." t)
+
+
+;;; =========================================================================
+;;;
+;;; Operations on entire Multifile documents
+
+(autoload 'reftex-create-tags-file "reftex-global"
+ "Create TAGS file by running `etags' on the current document." t)
+(autoload 'reftex-grep-document "reftex-global"
+ "Run grep query through all files related to this document." t)
+(autoload 'reftex-search-document "reftex-global"
+ "Regexp search through all files of the current TeX document." t)
+(autoload 'reftex-query-replace-document "reftex-global"
+ "Run a query-replace-regexp of FROM with TO over the entire TeX document." t)
+(autoload 'reftex-find-duplicate-labels "reftex-global"
+ "Produce a list of all duplicate labels in the document." t)
+(autoload 'reftex-change-label "reftex-global"
+ "Query replace FROM with TO in all \\label and \\ref commands." t)
+(autoload 'reftex-renumber-simple-labels "reftex-global"
+ "Renumber all simple labels in the document to make them sequentially." t)
+(autoload 'reftex-save-all-document-buffers "reftex-global"
+ "Save all documents associated with the current document." t)
+
+
+;;; =========================================================================
+;;;
+;;; AUCTeX Interface
+
+(autoload 'reftex-arg-label "reftex-auc")
+(autoload 'reftex-arg-cite "reftex-auc")
+(autoload 'reftex-arg-index-tag "reftex-auc")
+(autoload 'reftex-arg-index "reftex-auc")
+(autoload 'reftex-plug-into-AUCTeX "reftex-auc")
+(autoload 'reftex-toggle-plug-into-AUCTeX "reftex-auc"
+ "Toggle Interface between AUCTeX and RefTeX on and off." t)
+(autoload 'reftex-add-label-environments "reftex-auc")
+(autoload 'reftex-add-to-label-alist "reftex-auc")
+(autoload 'reftex-add-section-levels "reftex-auc")
+(autoload 'reftex-notice-new-section "reftex-auc")
+
;;;###autoload
(defun turn-on-reftex ()
"Turn on RefTeX mode."
(push dir path1)))
path1))
-;;; =========================================================================
-;;;
-;;; Parser functions
-
-(autoload 'reftex-parse-one "reftex-parse"
- "Re-parse this file." t)
-(autoload 'reftex-parse-all "reftex-parse"
- "Re-parse entire document." t)
-(autoload 'reftex-do-parse "reftex-parse")
-(autoload 'reftex-where-am-I "reftex-parse")
-(autoload 'reftex-init-section-numbers "reftex-parse")
-(autoload 'reftex-section-info "reftex-parse")
-(autoload 'reftex-section-number "reftex-parse")
-(autoload 'reftex-what-macro "reftex-parse")
-(autoload 'reftex-what-macro-safe "reftex-parse")
-(autoload 'reftex-index-info "reftex-parse")
-(autoload 'reftex-index-info-safe "reftex-parse")
-(autoload 'reftex-short-context "reftex-parse")
-(autoload 'reftex-what-environment "reftex-parse")
-(autoload 'reftex-what-special-env "reftex-parse")
-(autoload 'reftex-move-over-touching-args "reftex-parse")
-(autoload 'reftex-notice-new "reftex-parse")
-(autoload 'reftex-nth-arg "reftex-parse")
-(autoload 'reftex-locate-bibliography-files "reftex-parse")
-(autoload 'reftex-ensure-index-support "reftex-parse")
-(autoload 'reftex-everything-regexp "reftex-parse")
-
-
-;;; =========================================================================
-;;;
-;;; Labels and References
-
-(autoload 'reftex-label-location "reftex-ref")
-(autoload 'reftex-label-info-update "reftex-ref")
-(autoload 'reftex-label-info "reftex-ref")
-(autoload 'reftex-label "reftex-ref"
- "Insert a unique label." t)
-(autoload 'reftex-reference "reftex-ref"
- "Make a LaTeX reference." t)
-(autoload 'reftex-varioref-vref "reftex-ref"
- "Make a varioref reference." t)
-(autoload 'reftex-fancyref-fref "reftex-ref"
- "Make a fancyref \\fref reference." t)
-(autoload 'reftex-fancyref-Fref "reftex-ref"
- "Make a fancyref \\Fref reference." t)
-(autoload 'reftex-show-label-location "reftex-ref")
-(autoload 'reftex-query-label-type "reftex-ref")
-(autoload 'reftex-goto-label "reftex-ref"
- "Prompt for label name and go to that location." t)
-
-;;; =========================================================================
-;;;
-;;; Table of contents
-
-(autoload 'reftex-toc "reftex-toc"
- "Show the table of contents for the current document." t)
-(autoload 'reftex-toc-recenter "reftex-toc"
- "Display the TOC window and highlight line corresponding to current position." t)
-(autoload 'reftex-toggle-auto-toc-recenter "reftex-toc"
- "Toggle automatic recentering of TOC window." t)
-
-;;; =========================================================================
-;;;
-;;; BibTeX citations.
-
-(autoload 'reftex-citep "reftex-cite")
-(autoload 'reftex-citet "reftex-cite")
-(autoload 'reftex-make-cite-echo-string "reftex-cite")
-(autoload 'reftex-get-bibfile-list "reftex-cite")
-(autoload 'reftex-pop-to-bibtex-entry "reftex-cite")
-(autoload 'reftex-end-of-bib-entry "reftex-cite")
-(autoload 'reftex-parse-bibtex-entry "reftex-cite")
-(autoload 'reftex-citation "reftex-cite"
- "Make a citation using BibTeX database files." t)
-(autoload 'reftex-default-bibliography "reftex-cite")
-(autoload 'reftex-bib-or-thebib "reftex-cite")
-(autoload 'reftex-create-bibtex-file "reftex-cite")
-
-;;; =========================================================================
-;;;
-;;; Selection
-
-(autoload 'reftex-select-label-mode "reftex-sel")
-(autoload 'reftex-select-bib-mode "reftex-sel")
-(autoload 'reftex-find-start-point "reftex-sel")
-(autoload 'reftex-insert-docstruct "reftex-sel")
-(autoload 'reftex-get-offset "reftex-sel")
-(autoload 'reftex-select-item "reftex-sel")
-
-
-;;; =========================================================================
-;;;
-;;; Index support
-
-(autoload 'reftex-index "reftex-index"
- "Query for an index macro and insert it along with its argments." t)
-(autoload 'reftex-index-selection-or-word "reftex-index"
- "Put selection or the word near point into the default index macro." t)
-(autoload 'reftex-index-phrase-selection-or-word "reftex-index"
- "Put selection or the word near point into Index Phrases File." t)
-(autoload 'reftex-display-index "reftex-index"
- "Display a buffer with an index compiled from the current document." t)
-(autoload 'reftex-index-visit-phrases-buffer "reftex-index"
- "Visit the Index Phrases File." t)
-(autoload 'reftex-index-phrases-mode "reftex-index"
- "Major mode for managing the Index phrases of a LaTeX document." t)
-(autoload 'reftex-index-complete-tag "reftex-index")
-(autoload 'reftex-index-complete-key "reftex-index")
-(autoload 'reftex-index-show-entry "reftex-index")
-(autoload 'reftex-index-select-tag "reftex-index")
-
-
-;;; =========================================================================
-;;;
-;;; View cross references
-
-(autoload 'reftex-view-crossref "reftex-dcr"
- "View cross reference of \\ref or \\cite macro at point." t)
-(autoload 'reftex-mouse-view-crossref "reftex-dcr"
- "View cross reference of \\ref or \\cite macro where you click." t)
-(autoload 'reftex-toggle-auto-view-crossref "reftex-dcr")
-(autoload 'reftex-view-crossref-from-bibtex "reftex-dcr"
- "View location in a LaTeX document which cites the BibTeX entry at point." t)
-
-
-;;; =========================================================================
-;;;
-;;; Operations on entire Multifile documents
-
-(autoload 'reftex-create-tags-file "reftex-global"
- "Create TAGS file by running `etags' on the current document." t)
-(autoload 'reftex-grep-document "reftex-global"
- "Run grep query through all files related to this document." t)
-(autoload 'reftex-search-document "reftex-global"
- "Regexp search through all files of the current TeX document." t)
-(autoload 'reftex-query-replace-document "reftex-global"
- "Run a query-replace-regexp of FROM with TO over the entire TeX document." t)
-(autoload 'reftex-find-duplicate-labels "reftex-global"
- "Produce a list of all duplicate labels in the document." t)
-(autoload 'reftex-change-label "reftex-global"
- "Query replace FROM with TO in all \\label and \\ref commands." t)
-(autoload 'reftex-renumber-simple-labels "reftex-global"
- "Renumber all simple labels in the document to make them sequentially." t)
-(autoload 'reftex-save-all-document-buffers "reftex-global"
- "Save all documents associated with the current document." t)
-
-
-;;; =========================================================================
-;;;
-;;; AUCTeX Interface
-
-(autoload 'reftex-arg-label "reftex-auc")
-(autoload 'reftex-arg-cite "reftex-auc")
-(autoload 'reftex-arg-index-tag "reftex-auc")
-(autoload 'reftex-arg-index "reftex-auc")
-(autoload 'reftex-plug-into-AUCTeX "reftex-auc")
-(autoload 'reftex-toggle-plug-into-AUCTeX "reftex-auc"
- "Toggle Interface between AUCTeX and RefTeX on and off." t)
-(autoload 'reftex-add-label-environments "reftex-auc")
-(autoload 'reftex-add-to-label-alist "reftex-auc")
-(autoload 'reftex-add-section-levels "reftex-auc")
-(autoload 'reftex-notice-new-section "reftex-auc")
-
;;; =========================================================================
;;;
;;; Some generally useful functions
(if (facep face) (throw 'exit face)))))))
;; 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))
+(defalias 'reftex-make-overlay
+ (if (featurep 'xemacs) 'make-extent 'make-overlay))
+(defalias 'reftex-overlay-put
+ (if (featurep 'xemacs) 'set-extent-property 'overlay-put))
+(defalias 'reftex-move-overlay
+ (if (featurep 'xemacs) 'set-extent-endpoints 'move-overlay))
+(defalias 'reftex-delete-overlay
+ (if (featurep 'xemacs) 'detach-extent 'delete-overlay))
;; We keep a vector with several different overlays to do our highlighting.
(defvar reftex-highlight-overlays [nil nil nil])