;;; reftex-index.el --- index support with RefTeX
-;; Copyright (C) 1997-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2016 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
(defvar TeX-master)
;; END remove for XEmacs release
+;;;###autoload
(defun reftex-index-selection-or-word (&optional arg phrase)
"Put selection or the word near point into the default index macro.
This uses the information in `reftex-index-default-macro' to make an index
(delete-region beg end)
(reftex-index def-char full-entry def-tag sel)))))
+;;;###autoload
(defun reftex-index (&optional char key tag sel no-insert)
"Query for an index macro and insert it along with its arguments.
The index macros available are those defined in `reftex-index-macro' or
(member tag tag-list)))
(put reftex-docstruct-symbol 'default-index-tag tag)))
+;;;###autoload
(defun reftex-index-complete-tag (&optional itag opt-args)
;; Ask the user for a tag, completing on known tags.
;; ITAG is the argument number which contains the tag.
(reftex-update-default-index tag)
tag))
+;;;###autoload
(defun reftex-index-select-tag ()
;; Have the user select an index tag.
;; FIXME: should we cache tag-alist, prompt and help?
(error "No index tag associated with %c" rpl)))))
(t (error "This should not happen (reftex-index-select-tag)")))))
+;;;###autoload
(defun reftex-index-complete-key (&optional tag optional initial)
;; Read an index key, with completion.
;; Restrict completion table on index tag TAG.
} / { Restrict Index to a single document section / Widen.
< / > When restricted, move restriction to previous/next section.")
+;;;###autoload
(defun reftex-index-show-entry (data &optional no-revisit)
;; Find an index entry associated with DATA and display it highlighted
;; in another window. NO-REVISIT means we are not allowed to visit
(reftex-highlight 0 (match-beginning 0) (match-end 0) (current-buffer)))
match))
+;;;###autoload
(defun reftex-display-index (&optional tag overriding-restriction redo
&rest locations)
"Display a buffer with an index compiled from the current document.
(setq buffer-read-only nil)
(insert (format
-"INDEX <%s> on %s
+ "INDEX <%s> on %s
Restriction: <%s>
SPC=view TAB=goto RET=goto+hide [e]dit [q]uit [r]escan [f]ollow [?]Help
------------------------------------------------------------------------------
-" index-tag (abbreviate-file-name master)
-(if (eq (car (car reftex-index-restriction-data)) 'toc)
- (nth 2 (car reftex-index-restriction-data))
- reftex-index-restriction-indicator)))
+"
+ index-tag (abbreviate-file-name master)
+ (if (eq (car (car reftex-index-restriction-data)) 'toc)
+ (nth 2 (car reftex-index-restriction-data))
+ reftex-index-restriction-indicator)))
(if (reftex-use-fonts)
- (put-text-property 1 (point) 'face reftex-index-header-face))
- (put-text-property 1 (point) 'intangible t)
+ (put-text-property (point-min) (point)
+ 'face reftex-index-header-face))
+ (if (fboundp 'cursor-intangible-mode)
+ (cursor-intangible-mode 1)
+ ;; If `cursor-intangible' is not available, fallback on the old
+ ;; intrusive `intangible' property.
+ (put-text-property (point-min) (point) 'intangible t))
+ (add-text-properties (point-min) (point)
+ '(cursor-intangible t
+ front-sticky (cursor-intangible)
+ rear-nonsticky (cursor-intangible)))
(reftex-insert-index docstruct index-tag)
(goto-char (point-min))
(defun reftex-index-post-command-hook ()
;; Used in the post-command-hook for the *Index* buffer
+ ;; FIXME: Lots of redundancy with reftex-toc-post-command-hook!
(when (get-text-property (point) :data)
- (and (> (point) 1)
- (not (get-text-property (point) 'intangible))
+ (and (> (point) 1) ;FIXME: Is this point-min or do we care about narrowing?
+ (not (get-text-property (point) 'cursor-intangible))
(memq reftex-highlight-selection '(cursor both))
(reftex-highlight 1
(or (previous-single-property-change (1+ (point)) :data)
table)
"Syntax table for RefTeX Index Phrases mode.")
+;;;###autoload
(defun reftex-index-phrase-selection-or-word (arg)
"Add current selection or word at point to the phrases buffer.
When you are in transient-mark-mode and the region is active, the
(substitute-command-keys
"Return to LaTeX with \\[reftex-index-phrases-save-and-return]"))))
+;;;###autoload
(defun reftex-index-visit-phrases-buffer ()
"Switch to the phrases buffer, initialize if empty."
(interactive)
(defvar reftex-index-phrases-menu)
(defvar reftex-index-phrases-marker)
(defvar reftex-index-phrases-restrict-file nil)
+;; NB this is a global autoload - see reftex.el.
;;;###autoload
(define-derived-mode reftex-index-phrases-mode fundamental-mode "Phrases"
"Major mode for managing the Index phrases of a LaTeX document.
(provide 'reftex-index)
;;; reftex-index.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End: