don't use function-equal in nadvice
[bpt/emacs.git] / lisp / textmodes / reftex-toc.el
index 2beb3af..e164770 100644 (file)
@@ -1,6 +1,6 @@
 ;;; reftex-toc.el --- RefTeX's table of contents mode
 
-;; Copyright (C) 1997-2000, 2003-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2000, 2003-2014 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -190,6 +190,7 @@ M-%        Global search and replace to rename label at point.
 x          Switch to TOC of external document (with LaTeX package `xr').
 z          Jump to a specific section (e.g. '3 z' goes to section 3).")
 
+;;;###autoload
 (defun reftex-toc (&optional rebuild reuse)
   "Show the table of contents for the current document.
 When called with a raw C-u prefix, rescan the document first."
@@ -229,7 +230,7 @@ When called with a raw C-u prefix, rescan the document first."
                       (car (reftex-where-am-I))))
          (unsplittable (if (fboundp 'frame-property)
                            (frame-property (selected-frame) 'unsplittable)
-                         (frame-parameter (selected-frame) 'unsplittable)))
+                         (frame-parameter nil 'unsplittable)))
          offset toc-window)
 
     (if (setq toc-window (get-buffer-window
@@ -240,13 +241,13 @@ When called with a raw C-u prefix, rescan the document first."
                 (< (window-height) (* 2 window-min-height)))
         (delete-other-windows))
 
-      (setq reftex-last-window-width (window-width)
+      (setq reftex-last-window-width (window-total-width)
             reftex-last-window-height (window-height))  ; remember
 
       (unless unsplittable
         (if reftex-toc-split-windows-horizontally
             (split-window-right
-             (floor (* (window-width)
+             (floor (* (window-total-width)
                        reftex-toc-split-windows-fraction)))
           (split-window-below
            (floor (* (window-height)
@@ -319,6 +320,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
     (reftex-find-start-point (point) offset (get 'reftex-toc :reftex-line))
     (setq reftex-last-follow-point (point))))
 
+;;;###autoload
 (defun reftex-toc-recenter (&optional arg)
   "Display the TOC window and highlight line corresponding to current position."
   (interactive "P")
@@ -372,8 +374,8 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
 (defun reftex-re-enlarge ()
   "Enlarge window to a remembered size."
   (let ((count (if reftex-toc-split-windows-horizontally
-                  (- (or reftex-last-window-width (window-width))
-                     (window-width))
+                  (- (or reftex-last-window-width (window-total-width))
+                     (window-total-width))
                 (- (or reftex-last-window-height (window-height))
                    (window-height)))))
     (when (> count 0)
@@ -587,7 +589,7 @@ With prefix arg 1, restrict index to the section at point."
   (let ((unsplittable
          (if (fboundp 'frame-property)
              (frame-property (selected-frame) 'unsplittable)
-           (frame-parameter (selected-frame) 'unsplittable)))
+           (frame-parameter nil 'unsplittable)))
         (reftex-rebuilding-toc t))
     (if unsplittable
         (switch-to-buffer
@@ -785,7 +787,7 @@ PRO-OR-DE is assumed to be dynamically scoped into this function."
          (marker (nth 4 data)))
     (with-current-buffer (marker-buffer marker)
       (goto-char (marker-position marker))
-      (if (looking-at (concat "\\([ \t]*\\\\\\)" (regexp-quote name)))
+      (if (looking-at (concat "\\([ \t]*" reftex-section-pre-regexp "\\)" (regexp-quote name)))
           (replace-match (concat "\\1" newname))
         (error "Fatal error during %smotion" pro-or-de)))))
 
@@ -1009,6 +1011,7 @@ label prefix determines the wording of a reference."
        (let (current-prefix-arg)
          (reftex-toc-recenter))))
 
+;;;###autoload
 (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
@@ -1088,3 +1091,7 @@ always show the current section in connection with the option
       (reftex-toggle-auto-toc-recenter))))
 
 ;;; reftex-toc.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End: