comparison lisp/textmodes/reftex-toc.el @ 46612:7522419c4db0

Updated to reftex 4.17
author Carsten Dominik <dominik@science.uva.nl>
date Mon, 22 Jul 2002 10:36:26 +0000
parents f7ab2f136a79
children 060f433ebf11
comparison
equal deleted inserted replaced
46611:ae5b4f42f14c 46612:7522419c4db0
1 ;;; reftex-toc.el --- RefTeX's table of contents mode 1 ;;; reftex-toc.el --- RefTeX's table of contents mode
2 ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. 2 ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3 3
4 ;; Author: Carsten Dominik <dominik@strw.LeidenUniv.nl> 4 ;; Author: Carsten Dominik <dominik@science.uva.nl>
5 ;; Version: 4.16 5 ;; Version: 4.17
6 6
7 ;; This file is part of GNU Emacs. 7 ;; This file is part of GNU Emacs.
8 8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify 9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by 10 ;; it under the terms of the GNU General Public License as published by
70 70
71 (defvar reftex-last-toc-file nil 71 (defvar reftex-last-toc-file nil
72 "Stores the file name from which `reftex-toc' was called. For redo command.") 72 "Stores the file name from which `reftex-toc' was called. For redo command.")
73 73
74 (defvar reftex-last-window-height nil) 74 (defvar reftex-last-window-height nil)
75 (defvar reftex-last-window-width nil)
75 (defvar reftex-toc-include-labels-indicator nil) 76 (defvar reftex-toc-include-labels-indicator nil)
76 (defvar reftex-toc-include-index-indicator nil) 77 (defvar reftex-toc-include-index-indicator nil)
77 (defvar reftex-toc-max-level-indicator nil) 78 (defvar reftex-toc-max-level-indicator nil)
78 79
79 (defvar reftex-toc-return-marker (make-marker) 80 (defvar reftex-toc-return-marker (make-marker)
125 126
126 (let* ((this-buf (current-buffer)) 127 (let* ((this-buf (current-buffer))
127 (docstruct-symbol reftex-docstruct-symbol) 128 (docstruct-symbol reftex-docstruct-symbol)
128 (xr-data (assq 'xr (symbol-value reftex-docstruct-symbol))) 129 (xr-data (assq 'xr (symbol-value reftex-docstruct-symbol)))
129 (xr-alist (cons (cons "" (buffer-file-name)) (nth 1 xr-data))) 130 (xr-alist (cons (cons "" (buffer-file-name)) (nth 1 xr-data)))
130 (here-I-am (if rebuild 131 (here-I-am (if rebuild
131 (get 'reftex-toc :reftex-data) 132 (get 'reftex-toc :reftex-data)
132 (car (reftex-where-am-I)))) 133 (car (reftex-where-am-I))))
133 offset) 134 offset)
134 135
135 (if (get-buffer-window "*toc*") 136 (if (get-buffer-window "*toc*")
136 (select-window (get-buffer-window "*toc*")) 137 (select-window (get-buffer-window "*toc*"))
137 (when (or (not reftex-toc-keep-other-windows) 138 (when (or (not reftex-toc-keep-other-windows)
138 (< (window-height) (* 2 window-min-height))) 139 (< (window-height) (* 2 window-min-height)))
139 (delete-other-windows)) 140 (delete-other-windows))
140 (setq reftex-last-window-height (window-height)) ; remember 141
141 (split-window) 142 (setq reftex-last-window-width (window-width)
143 reftex-last-window-height (window-height)) ; remember
144 (if reftex-toc-split-windows-horizontally
145 (split-window-horizontally
146 (floor (* (frame-width) reftex-toc-split-windows-horizontally-fraction)))
147 (split-window))
148
142 (let ((default-major-mode 'reftex-toc-mode)) 149 (let ((default-major-mode 'reftex-toc-mode))
143 (switch-to-buffer "*toc*"))) 150 (switch-to-buffer "*toc*")))
144 151
145 (or (eq major-mode 'reftex-toc-mode) (reftex-toc-mode)) 152 (or (eq major-mode 'reftex-toc-mode) (reftex-toc-mode))
146 (set (make-local-variable 'reftex-docstruct-symbol) docstruct-symbol) 153 (set (make-local-variable 'reftex-docstruct-symbol) docstruct-symbol)
235 (reftex-toc-visit-location nil (not reftex-revisit-to-follow)) 242 (reftex-toc-visit-location nil (not reftex-revisit-to-follow))
236 (error t))))) 243 (error t)))))
237 244
238 (defun reftex-re-enlarge () 245 (defun reftex-re-enlarge ()
239 ;; Enlarge windiw to a remembered size 246 ;; Enlarge windiw to a remembered size
240 (enlarge-window 247 (if reftex-toc-split-windows-horizontally
241 (max 0 (- (or reftex-last-window-height (window-height)) 248 (enlarge-window-horizontally
242 (window-height))))) 249 (max 0 (- (or reftex-last-window-width (window-width))
250 (window-width))))
251 (enlarge-window
252 (max 0 (- (or reftex-last-window-height (window-height))
253 (window-height))))))
243 254
244 (defun reftex-toc-show-help () 255 (defun reftex-toc-show-help ()
245 "Show a summary of special key bindings." 256 "Show a summary of special key bindings."
246 (interactive) 257 (interactive)
247 (with-output-to-temp-buffer "*RefTeX Help*" 258 (with-output-to-temp-buffer "*RefTeX Help*"