]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/reftex-toc.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / textmodes / reftex-toc.el
index f4f3dc0719d65475f5b27af8c910c8dc4f4b8d2f..8d2287b51cb183a0c14aefadb7ec5198f380d6f0 100644 (file)
@@ -1,8 +1,10 @@
 ;;; reftex-toc.el --- RefTeX's table of contents mode
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005,
+;;   2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.21
+;; Maintainer: auctex-devel@gnu.org
+;; Version: 4.31
 
 ;; This file is part of GNU Emacs.
 
@@ -18,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
   "Keymap used for *toc* buffer.")
 
 (defvar reftex-toc-menu)
+(eval-when-compile (defvar zmacs-regions))
+(defvar reftex-last-window-height nil)
+(defvar reftex-last-window-width nil)
+(defvar reftex-toc-include-labels-indicator nil)
+(defvar reftex-toc-include-index-indicator nil)
+(defvar reftex-toc-max-level-indicator nil)
 
 (defun reftex-toc-mode ()
   "Major mode for managing Table of Contents for LaTeX files.
@@ -77,11 +85,6 @@ Here are all local bindings.
 (defvar reftex-last-toc-file nil
   "Stores the file name from which `reftex-toc' was called.  For redo command.")
 
-(defvar reftex-last-window-height nil)
-(defvar reftex-last-window-width nil)
-(defvar reftex-toc-include-labels-indicator nil)
-(defvar reftex-toc-include-index-indicator nil)
-(defvar reftex-toc-max-level-indicator nil)
 
 (defvar reftex-toc-return-marker (make-marker)
   "Marker which makes it possible to return from toc to old position.")
@@ -306,7 +309,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
                 (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 ()
@@ -543,6 +546,13 @@ Useful for large TOC's."
 
 ;; Promotion/Demotion stuff
 
+(defvar delta)
+(defvar mpos)
+(defvar pro-or-de)
+(defvar start-pos)
+(defvar start-line)
+(defvar mark-line)
+
 (defun reftex-toc-demote (&optional arg)
   "Demote section at point.  If region is active, apply to all in region."
   (interactive "p")
@@ -618,12 +628,6 @@ point."
             nil))
     (if msg (progn (ding) (message msg)))))
 
-(defvar delta)
-(defvar mpos)
-(defvar pro-or-de)
-(defvar start-pos)
-(defvar start-line)
-(defvar mark-line)
 
 (defun reftex-toc-restore-region (point-line &optional mark-line)
   (if mark-line
@@ -638,6 +642,10 @@ point."
           (setq mark-active t
                 deactivate-mark nil)))))
 
+(defvar name1)
+(defvar dummy)
+(defvar dummy2)
+
 (defun reftex-toc-promote-prepare (x)
   "Look at a toc entry and see if we could pro/demote it.
 Expects the level change DELTA to be dynamically scoped into this function.
@@ -754,13 +762,13 @@ if these sets are sorted blocks in the alist."
   "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.
-The variable PRO-OR-DE is assumed to be dynamically scoped into thes function.
+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))
     (reftex-toc-Rescan)
     (reftex-toc-restore-region start-line mark-line)
     (throw 'exit
-           (format "TOC had to be updated first.  Please check selection and repeat the command." pro-or-de))))
+           "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.
@@ -868,6 +876,7 @@ label prefix determines the wording of a reference."
            ((and (markerp marker) (marker-buffer marker))
             ;; Buffer is still live and we have the marker.  Should be easy.
             (switch-to-buffer-other-window (marker-buffer marker))
+            (push-mark nil)
             (goto-char (marker-position marker))
             (or (looking-at (regexp-quote literal))
                 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal))
@@ -1003,6 +1012,7 @@ always show the current section in connection with the option
 ;; Table of Contents map
 (define-key reftex-toc-map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
   'reftex-toc-mouse-goto-line-and-hide)
+(define-key reftex-toc-map [follow-link] 'mouse-face)
 
 (substitute-key-definition
  'next-line 'reftex-toc-next reftex-toc-map global-map)
@@ -1087,4 +1097,5 @@ always show the current section in connection with the option
    ["Help" reftex-toc-show-help t]))
 
 
-;;; reftex-toc.el ends here
\ No newline at end of file
+;;; arch-tag: 92400ce2-0b86-4c89-a606-4ed71acea17e
+;;; reftex-toc.el ends here