Add 2008 to copyright years.
[bpt/emacs.git] / lisp / textmodes / reftex-toc.el
index 8d217f0..1003fe3 100644 (file)
@@ -1,14 +1,16 @@
 ;;; reftex-toc.el --- RefTeX's table of contents mode
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005,
+;;   2006, 2007, 2008 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.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -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.
@@ -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)
@@ -1088,4 +1098,4 @@ always show the current section in connection with the option
 
 
 ;;; arch-tag: 92400ce2-0b86-4c89-a606-4ed71acea17e
-;;; reftex-toc.el ends here
\ No newline at end of file
+;;; reftex-toc.el ends here