(defvar reftex-toc-return-marker (make-marker)
- "Marker which makes it possible to return from toc to old position.")
+ "Marker which makes it possible to return from TOC to old position.")
(defconst reftex-toc-help
" AVAILABLE KEYS IN TOC BUFFER
============================
n / p next-line / previous-line
SPC Show the corresponding location of the LaTeX document.
-TAB Goto the location and keep the *toc* window.
-RET Goto the location and hide the *toc* window (also on mouse-2).
+TAB Goto the location and keep the TOC window.
+RET Goto the location and hide the TOC window (also on mouse-2).
< / > Promote / Demote section, or all sections in region.
C-c > Display Index. With prefix arg, restrict index to current section.
q / k Hide/Kill *toc* buffer, return to position of reftex-toc command.
(setq offset
(reftex-insert-docstruct
this-buf
- t ; include toc
+ t ; include TOC
reftex-toc-include-labels
reftex-toc-include-index-entries
reftex-toc-include-file-boundaries
nil ; commented
here-I-am
"" ; xr-prefix
- t ; a toc buffer
+ t ; a TOC buffer
))
(run-hooks 'reftex-display-copied-context-hook)
(frame-parameter frame 'name))
"RefTeX TOC Frame")))
(if (and res error)
- (error "This frame is view-only. Use `C-c =' to create toc window for commands"))
+ (error "This frame is view-only. Use `C-c =' to create TOC window for commands"))
res))
(defun reftex-toc-show-help ()
(goto-char (or (previous-single-property-change (point) :data)
(point))))
(defun reftex-toc-next-heading (&optional arg)
- "Move to next table of contentes line."
+ "Move to next table of contents line."
(interactive "p")
(when (featurep 'xemacs) (setq zmacs-region-stays t))
(end-of-line)
(re-search-forward "^ " nil t arg)
(beginning-of-line))
(defun reftex-toc-previous-heading (&optional arg)
- "Move to previous table of contentes line."
+ "Move to previous table of contents line."
(interactive "p")
(when (featurep 'xemacs) (setq zmacs-region-stays t))
(re-search-backward "^ " nil t arg))
(setq reftex-toc-include-context (not reftex-toc-include-context))
(reftex-toc-revert))
(defun reftex-toc-max-level (arg)
- "Set the maximum level of toc lines in this buffer to value of prefix ARG.
+ "Set the maximum level of TOC lines in this buffer to value of prefix ARG.
When no prefix is given, set the max level to a large number, so that all
levels are shown. For example, to set the level to 3, type `3 m'."
(interactive "P")
(reftex-toc-dframe-p nil 'error)
(reftex-toc-visit-location))
(defun reftex-toc-goto-line-and-hide ()
- "Go to document location in other window. Hide the *toc* window."
+ "Go to document location in other window. Hide the TOC window."
(interactive)
(reftex-toc-dframe-p nil 'error)
(reftex-toc-visit-location 'hide))
(defun reftex-toc-goto-line ()
- "Go to document location in other window. *toc* window stays."
+ "Go to document location in other window. TOC window stays."
(interactive)
(reftex-toc-dframe-p nil 'error)
(reftex-toc-visit-location t))
(defun reftex-toc-mouse-goto-line-and-hide (ev)
- "Go to document location in other window. Hide the *toc* window."
+ "Go to document location in other window. Hide the TOC window."
(interactive "e")
(mouse-set-point ev)
(reftex-toc-dframe-p nil 'error)
(reftex-toc-visit-location 'hide))
(defun reftex-toc-show-calling-point ()
- "Show point where reftex-toc was called from."
+ "Show point where `reftex-toc' was called from."
(interactive)
(reftex-toc-dframe-p nil 'error)
(let ((this-window (selected-window)))
(recenter '(4)))
(select-window this-window))))
(defun reftex-toc-quit ()
- "Hide the *toc* window and do not move point.
-If the toc window is the only window on the dedicated TOC frame, the frame
+ "Hide the TOC window and do not move point.
+If the TOC window is the only window on the dedicated TOC frame, the frame
is destroyed."
(interactive)
(if (and (one-window-p)
(reftex-toc)))
(defun reftex-toc-revert (&rest ignore)
- "Regenerate the *toc* from the internal lists."
+ "Regenerate the TOC from the internal lists."
(interactive)
(let ((unsplittable
(if (fboundp 'frame-property)
(defun reftex-toc-jump (arg)
"Jump to a specific section. E.g. '3 z' jumps to section 3.
-Useful for large TOC's."
+Useful for large TOCs."
(interactive "P")
(goto-char (point-min))
(re-search-forward
(interactive "p")
(reftex-toc-do-promote -1))
(defun reftex-toc-do-promote (delta)
- "Workhorse for reftex-toc-promote and reftex-to-demote.
+ "Workhorse for `reftex-toc-promote' and `reftex-toc-demote'.
Changes the level of sections in the current region, or just the section at
point."
;; We should not do anything unless we are sure this is going to work for
deactivate-mark nil)))))
(defun reftex-toc-promote-prepare (x delta)
- "Look at a toc entry and see if we could pro/demote it.
-This function prepares everything for the changes, but does not do it.
+ "Look at a TOC entry and see if we could pro/demote it.
+This function prepares everything for the change, but does not do it.
The return value is a list with information needed when doing the
promotion/demotion later. DELTA is the level change."
(let* ((data (car x))
(error "Cannot %smote \\%s" pro-or-de name))))
(defun reftex-toc-promote-action (x)
- "Change the level of a toc entry.
+ "Change the level of a TOC entry.
PRO-OR-DE is assumed to be dynamically scoped into this function."
(let* ((data (car x))
(name (nth 1 x))
(error "Fatal error during %smotion" pro-or-de)))))
(defun reftex-toc-extract-section-number (entry)
- "Get the numbering of a toc entry, for message purposes."
+ "Get the numbering of a TOC entry, for message purposes."
(if (string-match "\\s-*\\(\\S-+\\)" (nth 2 (car entry)))
(match-string 1 (nth 2 (car entry)))
"?"))
(defun reftex-toc-load-all-files-for-promotion ()
"Make sure all files of the document are being visited by buffers,
and that the scanning info is absolutely up to date.
-We do this by rescanning with reftex-keep-temporary-buffers bound to t.
+We do this by rescanning with `reftex-keep-temporary-buffers' bound to t.
The variable PRO-OR-DE is assumed to be dynamically scoped into this function.
When finished, we exit with an error message."
(let ((reftex-keep-temporary-buffers t))
"TOC had to be updated first. Please check selection and repeat the command.")))
(defun reftex-toc-rename-label ()
- "Rename the currently selected label in the *TOC* buffer.
+ "Rename the currently selected label in the *toc* buffer.
This launches a global search and replace in order to rename a label.
Renaming a label is hardly ever necessary - the only exception is after
promotion/demotion in connection with a package like fancyref, where the
(setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
(if (assoc newlabel (symbol-value reftex-docstruct-symbol))
(if (not (y-or-n-p
- (format "Label '%s' exists. Use anyway? " label)))
+ (format "Label '%s' exists. Use anyway? " label)))
(error "Abort")))
(save-excursion
(save-window-excursion
(defun reftex-toc-visit-location (&optional final no-revisit)
- ;; Visit the tex file corresponding to the toc entry on the current line.
+ ;; Visit the tex file corresponding to the TOC entry on the current line.
;; If FINAL is t, stay there
- ;; If FINAL is 'hide, hide the *toc* window.
- ;; Otherwise, move cursor back into *toc* window.
+ ;; If FINAL is 'hide, hide the TOC window.
+ ;; Otherwise, move cursor back into TOC window.
;; NO-REVISIT means don't visit files, just use live buffers.
;; This function is pretty clever about finding back a section heading,
;; even if the buffer is not live, or things like outline, x-symbol etc.
(toc-window (selected-window))
show-window show-buffer match)
- (unless toc (error "Don't know which toc line to visit"))
+ (unless toc (error "Don't know which TOC line to visit"))
(cond
(reftex-toc-recenter))))
(defun reftex-toggle-auto-toc-recenter ()
- "Toggle the automatic recentering of the toc window.
-When active, leaving point idle will make the toc window jump to the correct
+ "Toggle the automatic recentering of the TOC window.
+When active, leaving point idle will make the TOC window jump to the correct
section."
(interactive)
(if reftex-toc-auto-recenter-timer
(delete-itimer reftex-toc-auto-recenter-timer)
(cancel-timer reftex-toc-auto-recenter-timer))
(setq reftex-toc-auto-recenter-timer nil)
- (message "Automatic recentering of toc windwo was turned off"))
+ (message "Automatic recentering of TOC window was turned off"))
(setq reftex-toc-auto-recenter-timer
(if (featurep 'xemacs)
(start-itimer "RefTeX Idle Timer for recenter"
reftex-idle-time reftex-idle-time t)
(run-with-idle-timer
reftex-idle-time t 'reftex-recenter-toc-when-idle)))
- (message "Automatic recentering of toc window was turned on")))
+ (message "Automatic recentering of TOC window was turned on")))
(defun reftex-toc-toggle-dedicated-frame ()
"Toggle the display of a separate frame for the TOC.
(reftex-make-separate-toc-frame))))
(defun reftex-make-separate-toc-frame ()
- ;; Create a new fame showing only the toc buffer.
+ ;; Create a new fame showing only the TOC buffer.
(let ((current-frame (selected-frame))
(current-window (selected-window))
(current-toc-window (get-buffer-window "*toc*" 'visible))