Mercurial > emacs
annotate lisp/textmodes/reftex-toc.el @ 93964:46ac0eab32c3
Revert changes included by mistake in previous commit.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 10 Apr 2008 07:53:50 +0000 |
parents | bb437302d206 |
children | 1e3a407766b9 |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
1 ;;; reftex-toc.el --- RefTeX's table of contents mode |
68648
067115a6e738
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65638
diff
changeset
|
2 ;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, |
87633
2b38ed4ed1bb
Ralf Angeli <angeli at caeruleus.net>
Glenn Morris <rgm@gnu.org>
parents:
87170
diff
changeset
|
3 ;; 2006, 2007, 2008 Free Software Foundation, Inc. |
27035 | 4 |
46612
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
5 ;; Author: Carsten Dominik <dominik@science.uva.nl> |
76672
690423f53b08
* textmodes/reftex.el: Add maintainer address.
David Kastrup <dak@gnu.org>
parents:
75347
diff
changeset
|
6 ;; Maintainer: auctex-devel@gnu.org |
69094
bfd5c5e60410
Version number change only
Carsten Dominik <dominik@science.uva.nl>
parents:
68648
diff
changeset
|
7 ;; Version: 4.31 |
27035 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
78225
b6d25790aab2
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
76672
diff
changeset
|
13 ;; the Free Software Foundation; either version 3, or (at your option) |
27035 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
65638
e274642bf5d5
Update FSF street address; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65548
diff
changeset
|
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
e274642bf5d5
Update FSF street address; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65548
diff
changeset
|
24 ;; Boston, MA 02110-1301, USA. |
25280 | 25 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
26 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
27 |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
28 ;;; Code: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
29 |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
25280 | 31 (provide 'reftex-toc) |
32 (require 'reftex) | |
33 ;;; | |
34 | |
35 (defvar reftex-toc-map (make-sparse-keymap) | |
36 "Keymap used for *toc* buffer.") | |
37 | |
38 (defvar reftex-toc-menu) | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
39 (defvar reftex-last-window-height nil) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
40 (defvar reftex-last-window-width nil) |
65270
3c42ea656d31
(zmacs-regions): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64751
diff
changeset
|
41 (defvar reftex-toc-include-labels-indicator nil) |
3c42ea656d31
(zmacs-regions): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64751
diff
changeset
|
42 (defvar reftex-toc-include-index-indicator nil) |
3c42ea656d31
(zmacs-regions): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64751
diff
changeset
|
43 (defvar reftex-toc-max-level-indicator nil) |
25280 | 44 |
45 (defun reftex-toc-mode () | |
46 "Major mode for managing Table of Contents for LaTeX files. | |
47 This buffer was created with RefTeX. | |
48 Press `?' for a summary of important key bindings. | |
49 | |
50 Here are all local bindings. | |
51 | |
52 \\{reftex-toc-map}" | |
53 (interactive) | |
54 (kill-all-local-variables) | |
55 (setq major-mode 'reftex-toc-mode | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
56 mode-name "TOC") |
25280 | 57 (use-local-map reftex-toc-map) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
58 (set (make-local-variable 'transient-mark-mode) t) |
93097 | 59 (when (featurep 'xemacs) |
60 (set (make-local-variable 'zmacs-regions) t)) | |
25280 | 61 (set (make-local-variable 'revert-buffer-function) 'reftex-toc-revert) |
62 (set (make-local-variable 'reftex-toc-include-labels-indicator) "") | |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
63 (set (make-local-variable 'reftex-toc-max-level-indicator) |
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
64 (if (= reftex-toc-max-level 100) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
65 "ALL" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
66 (int-to-string reftex-toc-max-level))) |
25280 | 67 (setq mode-line-format |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
68 (list "---- " 'mode-line-buffer-identification |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
69 " " 'global-mode-string " (" mode-name ")" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
70 " L<" 'reftex-toc-include-labels-indicator ">" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
71 " I<" 'reftex-toc-include-index-indicator ">" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
72 " T<" 'reftex-toc-max-level-indicator ">" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
73 " -%-")) |
25280 | 74 (setq truncate-lines t) |
46683
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
75 (when (featurep 'xemacs) |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
76 ;; XEmacs needs the call to make-local-hook |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
77 (make-local-hook 'post-command-hook) |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
78 (make-local-hook 'pre-command-hook)) |
25280 | 79 (make-local-variable 'reftex-last-follow-point) |
80 (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t) | |
81 (add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t) | |
82 (easy-menu-add reftex-toc-menu reftex-toc-map) | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
83 (run-hooks 'reftex-toc-mode-hook)) |
25280 | 84 |
85 (defvar reftex-last-toc-file nil | |
86 "Stores the file name from which `reftex-toc' was called. For redo command.") | |
87 | |
88 | |
89 (defvar reftex-toc-return-marker (make-marker) | |
90 "Marker which makes it possible to return from toc to old position.") | |
91 | |
92 (defconst reftex-toc-help | |
93 " AVAILABLE KEYS IN TOC BUFFER | |
94 ============================ | |
95 n / p next-line / previous-line | |
96 SPC Show the corresponding location of the LaTeX document. | |
97 TAB Goto the location and keep the *toc* window. | |
98 RET Goto the location and hide the *toc* window (also on mouse-2). | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
99 < / > Promote / Demote section, or all sections in region. |
25280 | 100 C-c > Display Index. With prefix arg, restrict index to current section. |
101 q / k Hide/Kill *toc* buffer, return to position of reftex-toc command. | |
102 l i c F Toggle display of [l]abels, [i]ndex, [c]ontext, [F]ile borders. | |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
103 t Change maximum toc depth (e.g. `3 t' hides levels greater than 3). |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
104 f / g Toggle follow mode / Refresh *toc* buffer. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
105 a / d Toggle auto recenter / Toggle dedicated frame |
25280 | 106 r / C-u r Reparse the LaTeX document / Reparse entire LaTeX document. |
107 . In other window, show position from where `reftex-toc' was called. | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
108 M-% Global search and replace to rename label at point. |
37998
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
109 x Switch to TOC of external document (with LaTeX package `xr'). |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
110 z Jump to a specific section (e.g. '3 z' goes to section 3).") |
25280 | 111 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
112 (defun reftex-toc (&optional rebuild reuse) |
25280 | 113 "Show the table of contents for the current document. |
114 When called with a raw C-u prefix, rescan the document first." | |
115 | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
116 ;; The REUSE argument means, search all visible frames for a window |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
117 ;; displaying the toc window. If yes, reuse this window. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
118 |
25280 | 119 (interactive) |
120 | |
121 (if (or (not (string= reftex-last-toc-master (reftex-TeX-master-file))) | |
122 current-prefix-arg) | |
123 (reftex-erase-buffer "*toc*")) | |
124 | |
125 (setq reftex-last-toc-file (buffer-file-name)) | |
126 (setq reftex-last-toc-master (reftex-TeX-master-file)) | |
127 | |
128 (set-marker reftex-toc-return-marker (point)) | |
129 | |
130 ;; If follow mode is active, arrange to delay it one command | |
131 (if reftex-toc-follow-mode | |
132 (setq reftex-toc-follow-mode 1)) | |
133 | |
134 (and reftex-toc-include-index-entries | |
135 (reftex-ensure-index-support)) | |
136 (or reftex-support-index | |
137 (setq reftex-toc-include-index-entries nil)) | |
138 | |
139 ;; Ensure access to scanning info and rescan buffer if prefix are is '(4) | |
140 (reftex-access-scan-info current-prefix-arg) | |
141 | |
142 (let* ((this-buf (current-buffer)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
143 (docstruct-symbol reftex-docstruct-symbol) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
144 (xr-data (assq 'xr (symbol-value reftex-docstruct-symbol))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
145 (xr-alist (cons (cons "" (buffer-file-name)) (nth 1 xr-data))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
146 (here-I-am (if (boundp 'reftex-rebuilding-toc) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
147 (get 'reftex-toc :reftex-data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
148 (car (reftex-where-am-I)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
149 (unsplittable (if (fboundp 'frame-property) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
150 (frame-property (selected-frame) 'unsplittable) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
151 (frame-parameter (selected-frame) 'unsplittable))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
152 offset toc-window) |
25280 | 153 |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
154 (if (setq toc-window (get-buffer-window |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
155 "*toc*" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
156 (if reuse 'visible))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
157 (select-window toc-window) |
25280 | 158 (when (or (not reftex-toc-keep-other-windows) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
159 (< (window-height) (* 2 window-min-height))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
160 (delete-other-windows)) |
46612
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
161 |
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
162 (setq reftex-last-window-width (window-width) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
163 reftex-last-window-height (window-height)) ; remember |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
164 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
165 (unless unsplittable |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
166 (if reftex-toc-split-windows-horizontally |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
167 (split-window-horizontally |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
168 (floor (* (window-width) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
169 reftex-toc-split-windows-fraction))) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
170 (split-window-vertically |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
171 (floor (* (window-height) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
172 reftex-toc-split-windows-fraction))))) |
46612
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
173 |
25280 | 174 (let ((default-major-mode 'reftex-toc-mode)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
175 (switch-to-buffer "*toc*"))) |
25280 | 176 |
177 (or (eq major-mode 'reftex-toc-mode) (reftex-toc-mode)) | |
178 (set (make-local-variable 'reftex-docstruct-symbol) docstruct-symbol) | |
179 (setq reftex-toc-include-labels-indicator | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
180 (if (eq reftex-toc-include-labels t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
181 "ALL" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
182 reftex-toc-include-labels)) |
25280 | 183 (setq reftex-toc-include-index-indicator |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
184 (if (eq reftex-toc-include-index-entries t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
185 "ALL" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
186 reftex-toc-include-index-entries)) |
25280 | 187 |
188 (cond | |
189 ((= (buffer-size) 0) | |
190 ;; buffer is empty - fill it with the table of contents | |
191 (message "Building *toc* buffer...") | |
192 | |
193 (setq buffer-read-only nil) | |
194 (insert (format | |
195 "TABLE-OF-CONTENTS on %s | |
196 SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help | |
197 ------------------------------------------------------------------------------ | |
198 " (abbreviate-file-name reftex-last-toc-master))) | |
199 | |
200 (if (reftex-use-fonts) | |
50979
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
201 (put-text-property (point-min) (point) 'face reftex-toc-header-face)) |
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
202 (put-text-property (point-min) (point) 'intangible t) |
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
203 (put-text-property (point-min) (1+ (point-min)) 'xr-alist xr-alist) |
25280 | 204 |
205 (setq offset | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
206 (reftex-insert-docstruct |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
207 this-buf |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
208 t ; include toc |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
209 reftex-toc-include-labels |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
210 reftex-toc-include-index-entries |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
211 reftex-toc-include-file-boundaries |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
212 reftex-toc-include-context |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
213 nil ; counter |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
214 nil ; commented |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
215 here-I-am |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
216 "" ; xr-prefix |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
217 t ; a toc buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
218 )) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
219 |
25280 | 220 (run-hooks 'reftex-display-copied-context-hook) |
221 (message "Building *toc* buffer...done.") | |
222 (setq buffer-read-only t)) | |
223 (t | |
224 ;; Only compute the offset | |
225 (setq offset | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
226 (or (reftex-get-offset this-buf here-I-am |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
227 (if reftex-toc-include-labels " " nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
228 t |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
229 reftex-toc-include-index-entries |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
230 reftex-toc-include-file-boundaries) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
231 (reftex-last-assoc-before-elt |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
232 'toc here-I-am |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
233 (symbol-value reftex-docstruct-symbol)))) |
25280 | 234 (put 'reftex-toc :reftex-line 3) |
235 (goto-line 3) | |
236 (beginning-of-line))) | |
237 | |
238 ;; Find the correct starting point | |
239 (reftex-find-start-point (point) offset (get 'reftex-toc :reftex-line)) | |
240 (setq reftex-last-follow-point (point)))) | |
241 | |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
242 (defun reftex-toc-recenter (&optional arg) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
243 "Display the TOC window and highlight line corresponding to current position." |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
244 (interactive "P") |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
245 (let ((buf (current-buffer)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
246 (frame (selected-frame))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
247 (reftex-toc arg t) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
248 (if (= (count-lines 1 (point)) 2) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
249 (let ((current-prefix-arg nil)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
250 (select-window (get-buffer-window buf frame)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
251 (reftex-toc nil t))) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
252 (and (> (point) 1) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
253 (not (get-text-property (point) 'intangible)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
254 (memq reftex-highlight-selection '(cursor both)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
255 (reftex-highlight 2 |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
256 (or (previous-single-property-change |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
257 (min (point-max) (1+ (point))) :data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
258 (point-min)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
259 (or (next-single-property-change (point) :data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
260 (point-max)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
261 (select-window (get-buffer-window buf frame)))) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
262 |
25280 | 263 (defun reftex-toc-pre-command-hook () |
264 ;; used as pre command hook in *toc* buffer | |
265 (reftex-unhighlight 0) | |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
266 ) |
25280 | 267 |
268 (defun reftex-toc-post-command-hook () | |
269 ;; used in the post-command-hook for the *toc* buffer | |
270 (when (get-text-property (point) :data) | |
271 (put 'reftex-toc :reftex-data (get-text-property (point) :data)) | |
272 (and (> (point) 1) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
273 (not (get-text-property (point) 'intangible)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
274 (memq reftex-highlight-selection '(cursor both)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
275 (reftex-highlight 2 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
276 (or (previous-single-property-change (1+ (point)) :data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
277 (point-min)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
278 (or (next-single-property-change (point) :data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
279 (point-max))))) |
25280 | 280 (if (integerp reftex-toc-follow-mode) |
281 ;; remove delayed action | |
282 (setq reftex-toc-follow-mode t) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
283 (and (not (reftex-toc-dframe-p)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
284 reftex-toc-follow-mode |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
285 (not (equal reftex-last-follow-point (point))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
286 ;; show context in other window |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
287 (setq reftex-last-follow-point (point)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
288 (condition-case nil |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
289 (reftex-toc-visit-location nil (not reftex-revisit-to-follow)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
290 (error t))))) |
25280 | 291 |
292 (defun reftex-re-enlarge () | |
50979
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
293 ;; Enlarge window to a remembered size. |
46612
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
294 (if reftex-toc-split-windows-horizontally |
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
295 (enlarge-window-horizontally |
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
296 (max 0 (- (or reftex-last-window-width (window-width)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
297 (window-width)))) |
46612
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
298 (enlarge-window |
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
41785
diff
changeset
|
299 (max 0 (- (or reftex-last-window-height (window-height)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
300 (window-height)))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
301 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
302 (defun reftex-toc-dframe-p (&optional frame error) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
303 ;; Check if FRAME is the dedicated TOC frame. |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
304 ;; If yes, and ERROR is non-nil, throw an error. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
305 (setq frame (or frame (selected-frame))) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
306 (let ((res (equal |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
307 (if (fboundp 'frame-property) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
308 (frame-property frame 'name) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
309 (frame-parameter frame 'name)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
310 "RefTeX TOC Frame"))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
311 (if (and res error) |
63433
d70b1038ee22
(reftex-toc-dframe-p, reftex-toc-promote-prepare): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents:
62774
diff
changeset
|
312 (error "This frame is view-only. Use `C-c =' to create toc window for commands")) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
313 res)) |
25280 | 314 |
315 (defun reftex-toc-show-help () | |
316 "Show a summary of special key bindings." | |
317 (interactive) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
318 (reftex-toc-dframe-p nil 'error) |
25280 | 319 (with-output-to-temp-buffer "*RefTeX Help*" |
320 (princ reftex-toc-help)) | |
321 (reftex-enlarge-to-fit "*RefTeX Help*" t) | |
322 ;; If follow mode is active, arrange to delay it one command | |
323 (if reftex-toc-follow-mode | |
324 (setq reftex-toc-follow-mode 1))) | |
325 | |
326 (defun reftex-toc-next (&optional arg) | |
327 "Move to next selectable item." | |
328 (interactive "p") | |
87941
d77b6e5ee8af
* sieve.el (sieve-make-overlay, sieve-overlay-put, sieve-overlays-at):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87633
diff
changeset
|
329 (when (featurep 'xemacs) (setq zmacs-region-stays t)) |
25280 | 330 (setq reftex-callback-fwd t) |
331 (or (eobp) (forward-char 1)) | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
332 (goto-char (or (next-single-property-change (point) :data) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
333 (point)))) |
25280 | 334 (defun reftex-toc-previous (&optional arg) |
335 "Move to previous selectable item." | |
336 (interactive "p") | |
87941
d77b6e5ee8af
* sieve.el (sieve-make-overlay, sieve-overlay-put, sieve-overlays-at):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87633
diff
changeset
|
337 (when (featurep 'xemacs) (setq zmacs-region-stays t)) |
25280 | 338 (setq reftex-callback-fwd nil) |
339 (goto-char (or (previous-single-property-change (point) :data) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
340 (point)))) |
25280 | 341 (defun reftex-toc-next-heading (&optional arg) |
342 "Move to next table of contentes line." | |
343 (interactive "p") | |
87941
d77b6e5ee8af
* sieve.el (sieve-make-overlay, sieve-overlay-put, sieve-overlays-at):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87633
diff
changeset
|
344 (when (featurep 'xemacs) (setq zmacs-region-stays t)) |
25280 | 345 (end-of-line) |
346 (re-search-forward "^ " nil t arg) | |
347 (beginning-of-line)) | |
348 (defun reftex-toc-previous-heading (&optional arg) | |
349 "Move to previous table of contentes line." | |
350 (interactive "p") | |
87941
d77b6e5ee8af
* sieve.el (sieve-make-overlay, sieve-overlay-put, sieve-overlays-at):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87633
diff
changeset
|
351 (when (featurep 'xemacs) (setq zmacs-region-stays t)) |
25280 | 352 (re-search-backward "^ " nil t arg)) |
353 (defun reftex-toc-toggle-follow () | |
354 "Toggle follow (other window follows with context)." | |
355 (interactive) | |
356 (setq reftex-last-follow-point -1) | |
357 (setq reftex-toc-follow-mode (not reftex-toc-follow-mode))) | |
358 (defun reftex-toc-toggle-file-boundary () | |
359 "Toggle inclusion of file boundaries in *toc* buffer." | |
360 (interactive) | |
361 (setq reftex-toc-include-file-boundaries | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
362 (not reftex-toc-include-file-boundaries)) |
25280 | 363 (reftex-toc-revert)) |
364 (defun reftex-toc-toggle-labels (arg) | |
365 "Toggle inclusion of labels in *toc* buffer. | |
366 With prefix ARG, prompt for a label type and include only labels of | |
367 that specific type." | |
368 (interactive "P") | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
369 (setq reftex-toc-include-labels |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
370 (if arg (reftex-query-label-type) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
371 (not reftex-toc-include-labels))) |
25280 | 372 (reftex-toc-revert)) |
373 (defun reftex-toc-toggle-index (arg) | |
374 "Toggle inclusion of index in *toc* buffer. | |
375 With prefix arg, prompt for an index tag and include only entries of that | |
376 specific index." | |
377 (interactive "P") | |
378 (setq reftex-toc-include-index-entries | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
379 (if arg (reftex-index-select-tag) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
380 (not reftex-toc-include-index-entries))) |
25280 | 381 (reftex-toc-revert)) |
382 (defun reftex-toc-toggle-context () | |
383 "Toggle inclusion of label context in *toc* buffer. | |
384 Label context is only displayed when the labels are there as well." | |
385 (interactive) | |
386 (setq reftex-toc-include-context (not reftex-toc-include-context)) | |
387 (reftex-toc-revert)) | |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
388 (defun reftex-toc-max-level (arg) |
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
389 "Set the maximum level of toc lines in this buffer to value of prefix ARG. |
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
390 When no prefix is given, set the max level to a large number, so that all |
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
391 levels are shown. For eaxample, to set the level to 3, type `3 m'." |
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
392 (interactive "P") |
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
393 (setq reftex-toc-max-level (if arg |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
394 (prefix-numeric-value arg) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
395 100)) |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
396 (setq reftex-toc-max-level-indicator |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
397 (if arg (int-to-string reftex-toc-max-level) "ALL")) |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
398 (reftex-toc-revert)) |
25280 | 399 (defun reftex-toc-view-line () |
400 "View document location in other window." | |
401 (interactive) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
402 (reftex-toc-dframe-p nil 'error) |
25280 | 403 (reftex-toc-visit-location)) |
404 (defun reftex-toc-goto-line-and-hide () | |
405 "Go to document location in other window. Hide the *toc* window." | |
406 (interactive) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
407 (reftex-toc-dframe-p nil 'error) |
25280 | 408 (reftex-toc-visit-location 'hide)) |
409 (defun reftex-toc-goto-line () | |
410 "Go to document location in other window. *toc* window stays." | |
411 (interactive) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
412 (reftex-toc-dframe-p nil 'error) |
25280 | 413 (reftex-toc-visit-location t)) |
414 (defun reftex-toc-mouse-goto-line-and-hide (ev) | |
415 "Go to document location in other window. Hide the *toc* window." | |
416 (interactive "e") | |
417 (mouse-set-point ev) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
418 (reftex-toc-dframe-p nil 'error) |
25280 | 419 (reftex-toc-visit-location 'hide)) |
420 (defun reftex-toc-show-calling-point () | |
421 "Show point where reftex-toc was called from." | |
422 (interactive) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
423 (reftex-toc-dframe-p nil 'error) |
25280 | 424 (let ((this-window (selected-window))) |
425 (unwind-protect | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
426 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
427 (switch-to-buffer-other-window |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
428 (marker-buffer reftex-toc-return-marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
429 (goto-char (marker-position reftex-toc-return-marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
430 (recenter '(4))) |
25280 | 431 (select-window this-window)))) |
432 (defun reftex-toc-quit () | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
433 "Hide the *toc* window and do not move point. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
434 If the toc window is the only window on the dedicated TOC frame, the frame |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
435 is destroyed." |
25280 | 436 (interactive) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
437 (if (and (one-window-p) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
438 (reftex-toc-dframe-p) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
439 (> (length (frame-list)) 1)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
440 (delete-frame) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
441 (or (one-window-p) (delete-window)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
442 (switch-to-buffer (marker-buffer reftex-toc-return-marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
443 (reftex-re-enlarge) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
444 (goto-char (or (marker-position reftex-toc-return-marker) (point))))) |
25280 | 445 (defun reftex-toc-quit-and-kill () |
446 "Kill the *toc* buffer." | |
447 (interactive) | |
448 (kill-buffer "*toc*") | |
449 (or (one-window-p) (delete-window)) | |
450 (switch-to-buffer (marker-buffer reftex-toc-return-marker)) | |
451 (reftex-re-enlarge) | |
452 (goto-char (marker-position reftex-toc-return-marker))) | |
453 (defun reftex-toc-display-index (&optional arg) | |
454 "Display the index buffer for the current document. | |
455 This works just like `reftex-display-index' from a LaTeX buffer. | |
456 With prefix arg 1, restrict index to the section at point." | |
457 (interactive "P") | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
458 (reftex-toc-dframe-p nil 'error) |
25280 | 459 (let ((data (get-text-property (point) :data)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
460 (docstruct (symbol-value reftex-docstruct-symbol)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
461 bor eor restr) |
25280 | 462 (when (equal arg 2) |
463 (setq bor (reftex-last-assoc-before-elt 'toc data docstruct) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
464 eor (assoc 'toc (cdr (memq bor docstruct))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
465 restr (list (nth 6 bor) bor eor))) |
25280 | 466 (reftex-toc-goto-line) |
467 (reftex-display-index (if restr nil arg) restr))) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
468 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
469 ;; Rescanning the document and rebuilding the TOC buffer. |
25280 | 470 (defun reftex-toc-rescan (&rest ignore) |
471 "Regenerate the *toc* buffer by reparsing file of section at point." | |
472 (interactive) | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
473 (if (and reftex-enable-partial-scans |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
474 (null current-prefix-arg)) |
25280 | 475 (let* ((data (get-text-property (point) :data)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
476 (what (car data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
477 (file (cond ((eq what 'toc) (nth 3 data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
478 ((memq what '(eof bof file-error)) (nth 1 data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
479 ((stringp what) (nth 3 data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
480 ((eq what 'index) (nth 3 data)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
481 (line (+ (count-lines (point-min) (point)) (if (bolp) 1 0)))) |
25280 | 482 (if (not file) |
483 (error "Don't know which file to rescan. Try `C-u r'") | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
484 (put 'reftex-toc :reftex-line line) |
25280 | 485 (switch-to-buffer-other-window |
486 (reftex-get-file-buffer-force file)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
487 (setq current-prefix-arg '(4)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
488 (let ((reftex-rebuilding-toc t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
489 (reftex-toc)))) |
25280 | 490 (reftex-toc-Rescan)) |
491 (reftex-kill-temporary-buffers)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
492 |
25280 | 493 (defun reftex-toc-Rescan (&rest ignore) |
494 "Regenerate the *toc* buffer by reparsing the entire document." | |
495 (interactive) | |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
496 (let* ((line (+ (count-lines (point-min) (point)) (if (bolp) 1 0)))) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
497 (put 'reftex-toc :reftex-line line)) |
25280 | 498 (switch-to-buffer-other-window |
499 (reftex-get-file-buffer-force reftex-last-toc-file)) | |
500 (setq current-prefix-arg '(16)) | |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
501 (let ((reftex-rebuilding-toc t)) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
502 (reftex-toc))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
503 |
25280 | 504 (defun reftex-toc-revert (&rest ignore) |
505 "Regenerate the *toc* from the internal lists." | |
506 (interactive) | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
507 (let ((unsplittable |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
508 (if (fboundp 'frame-property) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
509 (frame-property (selected-frame) 'unsplittable) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
510 (frame-parameter (selected-frame) 'unsplittable))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
511 (reftex-rebuilding-toc t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
512 (if unsplittable |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
513 (switch-to-buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
514 (reftex-get-file-buffer-force reftex-last-toc-file)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
515 (switch-to-buffer-other-window |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
516 (reftex-get-file-buffer-force reftex-last-toc-file)))) |
25280 | 517 (reftex-erase-buffer "*toc*") |
518 (setq current-prefix-arg nil) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
519 (reftex-toc t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
520 |
25280 | 521 (defun reftex-toc-external (&rest ignore) |
522 "Switch to table of contents of an external document." | |
523 (interactive) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
524 (reftex-toc-dframe-p nil 'error) |
25280 | 525 (let* ((old-buf (current-buffer)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
526 (xr-alist (get-text-property 1 'xr-alist)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
527 (xr-index (reftex-select-external-document |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
528 xr-alist 0))) |
25280 | 529 (switch-to-buffer-other-window (or (reftex-get-file-buffer-force |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
530 (cdr (nth xr-index xr-alist))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
531 (error "Cannot switch document"))) |
25280 | 532 (reftex-toc) |
533 (if (equal old-buf (current-buffer)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
534 (message "") |
25280 | 535 (message "Switched document")))) |
536 | |
37998
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
537 (defun reftex-toc-jump (arg) |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
538 "Jump to a specific section. E.g. '3 z' jumps to section 3. |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
539 Useful for large TOC's." |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
540 (interactive "P") |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
541 (goto-char (point-min)) |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
542 (re-search-forward |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
543 (concat "^ *" (number-to-string (if (numberp arg) arg 1)) " ") |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
544 nil t) |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
545 (beginning-of-line)) |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
546 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
547 ;; Promotion/Demotion stuff |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
548 |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
549 (defvar delta) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
550 (defvar mpos) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
551 (defvar pro-or-de) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
552 (defvar start-pos) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
553 (defvar start-line) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
554 (defvar mark-line) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
555 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
556 (defun reftex-toc-demote (&optional arg) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
557 "Demote section at point. If region is active, apply to all in region." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
558 (interactive "p") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
559 (reftex-toc-do-promote 1)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
560 (defun reftex-toc-promote (&optional arg) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
561 "Promote section at point. If region is active, apply to all in region." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
562 (interactive "p") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
563 (reftex-toc-do-promote -1)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
564 (defun reftex-toc-do-promote (delta) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
565 "Workhorse for reftex-toc-promote and reftex-to-demote. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
566 Changes the level of sections in the current region, or just the section at |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
567 point." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
568 ;; We should not do anything unless we are sure this is going to work for |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
569 ;; each section in the region. Therefore we first collect information and |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
570 ;; test. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
571 (let* ((start-line (+ (count-lines (point-min) (point)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
572 (if (bolp) 1 0))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
573 (mark-line (if (reftex-region-active-p) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
574 (save-excursion (goto-char (mark)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
575 (+ (count-lines (point-min) (point)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
576 (if (bolp) 1 0))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
577 (start-pos (point)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
578 (pro-or-de (if (> delta 0) "de" "pro")) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
579 beg end entries data sections nsec mpos msg) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
580 (setq msg |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
581 (catch 'exit |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
582 (if (reftex-region-active-p) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
583 ;; A region is dangerous, check if we have a brandnew scan, |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
584 ;; to make sure we are not missing any section statements. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
585 (if (not (reftex-toc-check-docstruct)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
586 (reftex-toc-load-all-files-for-promotion) ;; exits |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
587 (setq beg (min (point) (mark)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
588 end (max (point) (mark)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
589 (setq beg (point) end (point))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
590 (goto-char beg) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
591 (while (and (setq data (get-text-property (point) :data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
592 (<= (point) end)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
593 (if (eq (car data) 'toc) (push (cons data (point)) entries)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
594 (goto-char (or (next-single-property-change (point) :data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
595 (point-max)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
596 (setq entries (nreverse entries)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
597 ;; Get the relevant section numbers, for an informative message |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
598 (goto-char start-pos) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
599 (setq sections (reftex-toc-extract-section-number (car entries))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
600 (if (> (setq nsec (length entries)) 1) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
601 (setq sections |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
602 (concat sections "-" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
603 (reftex-toc-extract-section-number |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
604 (nth (1- nsec) entries))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
605 ;; Run through the list and prepare the changes. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
606 (setq entries (mapcar 'reftex-toc-promote-prepare entries)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
607 ;; Ask for permission |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
608 (if (or (not reftex-toc-confirm-promotion) ; never confirm |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
609 (and (integerp reftex-toc-confirm-promotion) ; confirm if many |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
610 (< nsec reftex-toc-confirm-promotion)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
611 (yes-or-no-p ; ask |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
612 (format "%s %d toc-entr%s (section%s %s)? " |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
613 (if (< delta 0) "Promote" "Demote") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
614 nsec |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
615 (if (= 1 nsec) "y" "ies") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
616 (if (= 1 nsec) "" "s") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
617 sections))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
618 nil ; we have permission, do nothing |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
619 (error "Abort")) ; abort, we don't have permission |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
620 ;; Do the changes |
85195
718f0bcfdb7c
(reftex-toc-do-promote): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
621 (mapc 'reftex-toc-promote-action entries) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
622 ;; Rescan the document and rebuilt the toc buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
623 (save-window-excursion |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
624 (reftex-toc-Rescan)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
625 (reftex-toc-restore-region start-line mark-line) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
626 (message "%d section%s %smoted" |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
627 nsec (if (= 1 nsec) "" "s") pro-or-de) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
628 nil)) |
87170
e50a2e215441
* erc-stamp.el (erc-echo-timestamp):
David Kastrup <dak@gnu.org>
parents:
87022
diff
changeset
|
629 (if msg (progn (ding) (message "%s" msg))))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
630 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
631 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
632 (defun reftex-toc-restore-region (point-line &optional mark-line) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
633 (if mark-line |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
634 (progn (goto-line mark-line) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
635 (setq mpos (point)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
636 (if point-line (goto-line point-line)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
637 (if mark-line |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
638 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
639 (set-mark mpos) |
87941
d77b6e5ee8af
* sieve.el (sieve-make-overlay, sieve-overlay-put, sieve-overlays-at):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87633
diff
changeset
|
640 (if (featurep 'xemacs) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
641 (zmacs-activate-region) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
642 (setq mark-active t |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
643 deactivate-mark nil))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
644 |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
645 (defvar name1) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
646 (defvar dummy) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
647 (defvar dummy2) |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
648 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
649 (defun reftex-toc-promote-prepare (x) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
650 "Look at a toc entry and see if we could pro/demote it. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
651 Expects the level change DELTA to be dynamically scoped into this function. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
652 This function prepares everything for the changes, but does not do it. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
653 The return value is a list with information needed when doing the |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
654 promotion/demotion later." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
655 (let* ((data (car x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
656 (toc-point (cdr x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
657 (marker (nth 4 data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
658 (literal (nth 7 data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
659 (load nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
660 (name nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
661 ;; Here follows some paranoid code to make very sure we are not |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
662 ;; going to break anything |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
663 (name1 ; dummy |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
664 (if (and (markerp marker) (marker-buffer marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
665 ;; Buffer is still live and we have the marker. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
666 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
667 (save-excursion |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
668 ;; Goto the buffer and check of section is unchanged |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
669 (set-buffer (marker-buffer marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
670 (goto-char (marker-position marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
671 (if (looking-at (regexp-quote literal)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
672 ;; OK, get the makro name |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
673 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
674 (beginning-of-line 1) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
675 (if (looking-at reftex-section-regexp) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
676 (setq name (reftex-match-string 2)) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
677 (error "Something is wrong! Contact maintainer!"))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
678 ;; Section has changed, request scan and loading |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
679 ;; We use a variable to delay until after the safe-exc. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
680 ;; because otherwise we loose the region. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
681 (setq load t))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
682 ;; Scan document and load all files, this exits command |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
683 (if load (reftex-toc-load-all-files-for-promotion))) ; exits |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
684 ;; We don't have a live marker: scan and load files. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
685 (reftex-toc-load-all-files-for-promotion))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
686 (level (cdr (assoc name reftex-section-levels-all))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
687 (dummy (if (not (integerp level)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
688 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
689 (goto-char toc-point) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
690 (error "Cannot %smote special sections" pro-or-de)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
691 ;; Delta is dynamically scoped into here... |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
692 (newlevel (if (>= level 0) (+ delta level) (- level delta))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
693 (dummy2 (if (or (and (>= level 0) (= newlevel -1)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
694 (and (< level 0) (= newlevel 0))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
695 (error "Cannot %smote \\%s" pro-or-de name))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
696 (newname (reftex-toc-newhead-from-alist newlevel name |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
697 reftex-section-levels-all))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
698 (if (and name newname) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
699 (list data name newname toc-point) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
700 (goto-char toc-point) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
701 (error "Cannot %smote \\%s" pro-or-de name)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
702 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
703 (defun reftex-toc-promote-action (x) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
704 "Change the level of a toc entry. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
705 DELTA and PRO-OR-DE are assumed to be dynamically scoped into this function." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
706 (let* ((data (car x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
707 (name (nth 1 x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
708 (newname (nth 2 x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
709 (marker (nth 4 data))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
710 (save-excursion |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
711 (set-buffer (marker-buffer marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
712 (goto-char (marker-position marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
713 (if (looking-at (concat "\\([ \t]*\\\\\\)" (regexp-quote name))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
714 (replace-match (concat "\\1" newname)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
715 (error "Fatal error during %smotion" pro-or-de))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
716 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
717 (defun reftex-toc-extract-section-number (entry) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
718 "Get the numbering of a toc entry, for message purposes." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
719 (if (string-match "\\s-*\\(\\S-+\\)" (nth 2 (car entry))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
720 (match-string 1 (nth 2 (car entry))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
721 "?")) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
722 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
723 (defun reftex-toc-newhead-from-alist (nlevel head alist) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
724 "Get new heading with level NLEVEL from ALIST. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
725 If there are no such entries, return nil. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
726 If there are several different entries with same new level, choose |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
727 the one with the smallest distance to the assocation of HEAD in the alist. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
728 This makes it possible for promotion to work several sets of headings, |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
729 if these sets are sorted blocks in the alist." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
730 (let* ((al alist) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
731 (ass (assoc head al)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
732 (pos (length (memq ass al))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
733 dist (mindist 1000) newhead) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
734 (while al |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
735 (if (equal (cdar al) nlevel) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
736 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
737 (setq dist (abs (- (length al) pos))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
738 (if (< dist mindist) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
739 (setq newhead (car (car al)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
740 mindist dist)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
741 (setq al (cdr al))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
742 newhead)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
743 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
744 (defun reftex-toc-check-docstruct () |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
745 "Check if the current docstruct is fully up to date and all files visited." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
746 ;; We do this by checking if all sections are on the right position |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
747 (let ((docstruct (symbol-value reftex-docstruct-symbol)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
748 entry marker empoint) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
749 (catch 'exit |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
750 (while (setq entry (pop docstruct)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
751 (if (eq (car entry) 'toc) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
752 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
753 (setq marker (nth 4 entry) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
754 empoint (nth 8 entry)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
755 (if (not (and (markerp marker) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
756 (marker-buffer marker) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
757 (= (marker-position marker) empoint))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
758 (throw 'exit nil))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
759 t))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
760 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
761 (defun reftex-toc-load-all-files-for-promotion () |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
762 "Make sure all files of the document are being visited by buffers, |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
763 and that the scanning info is absolutely up to date. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
764 We do this by rescanning with reftex-keep-temporary-buffers bound to t. |
59579
a588c86a429c
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-40
Miles Bader <miles@gnu.org>
parents:
59534
diff
changeset
|
765 The variable PRO-OR-DE is assumed to be dynamically scoped into this function. |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
766 When finished, we exit with an error message." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
767 (let ((reftex-keep-temporary-buffers t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
768 (reftex-toc-Rescan) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
769 (reftex-toc-restore-region start-line mark-line) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
770 (throw 'exit |
59579
a588c86a429c
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-40
Miles Bader <miles@gnu.org>
parents:
59534
diff
changeset
|
771 "TOC had to be updated first. Please check selection and repeat the command."))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
772 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
773 (defun reftex-toc-rename-label () |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
774 "Rename the currently selected label in the *TOC* buffer. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
775 This launches a global search and replace in order to rename a label. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
776 Renaming a label is hardly ever necessary - the only exeption is after |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
777 promotion/demotion in connection with a package like fancyref, where the |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
778 label prefix determines the wording of a reference." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
779 (interactive) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
780 (let* ((toc (get-text-property (point) :data)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
781 (label (car toc)) newlabel) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
782 (if (not (stringp label)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
783 (error "This is not a label entry.")) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
784 (setq newlabel (read-string (format "Rename label \"%s\" to:" label))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
785 (if (assoc newlabel (symbol-value reftex-docstruct-symbol)) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
786 (if (not (y-or-n-p |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
787 (format "Label '%s' exists. Use anyway? " label))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
788 (error "Abort"))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
789 (save-excursion |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
790 (save-window-excursion |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
791 (reftex-toc-visit-location t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
792 (condition-case nil |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
793 (reftex-query-replace-document |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
794 (concat "{" (regexp-quote label) "}") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
795 (format "{%s}" newlabel)) |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
796 (error t)))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
797 (reftex-toc-rescan))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
798 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
799 |
25280 | 800 (defun reftex-toc-visit-location (&optional final no-revisit) |
801 ;; Visit the tex file corresponding to the toc entry on the current line. | |
802 ;; If FINAL is t, stay there | |
803 ;; If FINAL is 'hide, hide the *toc* window. | |
804 ;; Otherwise, move cursor back into *toc* window. | |
50979
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
805 ;; NO-REVISIT means don't visit files, just use live buffers. |
25280 | 806 ;; This function is pretty clever about finding back a section heading, |
807 ;; even if the buffer is not live, or things like outline, x-symbol etc. | |
808 ;; have been active. | |
809 | |
810 (let* ((toc (get-text-property (point) :data)) | |
811 (toc-window (selected-window)) | |
812 show-window show-buffer match) | |
813 | |
814 (unless toc (error "Don't know which toc line to visit")) | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
815 |
25280 | 816 (cond |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
817 |
25280 | 818 ((eq (car toc) 'toc) |
819 ;; a toc entry | |
820 (setq match (reftex-toc-find-section toc no-revisit))) | |
821 | |
822 ((eq (car toc) 'index) | |
823 ;; an index entry | |
824 (setq match (reftex-index-show-entry toc no-revisit))) | |
825 | |
826 ((memq (car toc) '(bof eof)) | |
827 ;; A file entry | |
828 (setq match | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
829 (let ((where (car toc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
830 (file (nth 1 toc))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
831 (if (or (not no-revisit) (reftex-get-buffer-visiting file)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
832 (progn |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
833 (switch-to-buffer-other-window |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
834 (reftex-get-file-buffer-force file nil)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
835 (goto-char (if (eq where 'bof) (point-min) (point-max)))) |
87170
e50a2e215441
* erc-stamp.el (erc-echo-timestamp):
David Kastrup <dak@gnu.org>
parents:
87022
diff
changeset
|
836 (message "%s" reftex-no-follow-message) nil)))) |
25280 | 837 |
838 ((stringp (car toc)) | |
839 ;; a label | |
840 (setq match (reftex-show-label-location toc reftex-callback-fwd | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
841 no-revisit t)))) |
25280 | 842 |
843 (setq show-window (selected-window) | |
844 show-buffer (current-buffer)) | |
845 | |
846 (unless match | |
847 (select-window toc-window) | |
848 (error "Cannot find location")) | |
849 | |
850 (select-window toc-window) | |
851 | |
852 ;; use the `final' parameter to decide what to do next | |
853 (cond | |
854 ((eq final t) | |
855 (reftex-unhighlight 0) | |
856 (select-window show-window)) | |
857 ((eq final 'hide) | |
858 (reftex-unhighlight 0) | |
859 (or (one-window-p) (delete-window)) | |
50979
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
860 ;; If `show-window' is still live, show-buffer is already visible |
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
861 ;; so let's not make it visible in yet-another-window. |
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
862 (if (window-live-p show-window) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
863 (set-buffer show-buffer) |
50979
85e525daebfc
(reftex-toc-visit-location):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
864 (switch-to-buffer show-buffer)) |
25280 | 865 (reftex-re-enlarge)) |
866 (t nil)))) | |
867 | |
868 (defun reftex-toc-find-section (toc &optional no-revisit) | |
869 (let* ((file (nth 3 toc)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
870 (marker (nth 4 toc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
871 (level (nth 5 toc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
872 (literal (nth 7 toc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
873 (emergency-point (nth 8 toc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
874 (match |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
875 (cond |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
876 ((and (markerp marker) (marker-buffer marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
877 ;; Buffer is still live and we have the marker. Should be easy. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
878 (switch-to-buffer-other-window (marker-buffer marker)) |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
53852
diff
changeset
|
879 (push-mark nil) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
880 (goto-char (marker-position marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
881 (or (looking-at (regexp-quote literal)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
882 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
883 (looking-at (reftex-make-desperate-section-regexp literal)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
884 (looking-at (concat "\\\\" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
885 (regexp-quote |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
886 (car |
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
887 (rassq level |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
888 reftex-section-levels-all))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
889 "[[{]?")))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
890 ((or (not no-revisit) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
891 (reftex-get-buffer-visiting file)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
892 ;; Marker is lost. Use the backup method. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
893 (switch-to-buffer-other-window |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
894 (reftex-get-file-buffer-force file nil)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
895 (goto-char (or emergency-point (point-min))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
896 (or (looking-at (regexp-quote literal)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
897 (let ((len (length literal))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
898 (or (reftex-nearest-match (regexp-quote literal) len) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
899 (reftex-nearest-match |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
900 (reftex-make-regexp-allow-for-ctrl-m literal) len) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
901 (reftex-nearest-match |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
902 (reftex-make-desperate-section-regexp literal) len))))) |
87170
e50a2e215441
* erc-stamp.el (erc-echo-timestamp):
David Kastrup <dak@gnu.org>
parents:
87022
diff
changeset
|
903 (t (message "%s" reftex-no-follow-message) nil)))) |
25280 | 904 (when match |
905 (goto-char (match-beginning 0)) | |
906 (if (not (= (point) (point-max))) (recenter 1)) | |
907 (reftex-highlight 0 (match-beginning 0) (match-end 0) (current-buffer))) | |
908 match)) | |
909 | |
910 (defun reftex-make-desperate-section-regexp (old) | |
911 ;; Return a regexp which will still match a section statement even if | |
912 ;; x-symbol or isotex or the like have been at work in the mean time. | |
913 (let* ((n (1+ (string-match "[[{]" old))) | |
914 (new (regexp-quote (substring old 0 (1+ (string-match "[[{]" old))))) | |
915 (old (substring old n))) | |
916 (while (string-match | |
917 "\\([\r\n]\\)\\|\\(\\`\\|[ \t\n\r]\\)\\([a-zA-Z0-9]+\\)\\([ \t\n\r]\\|}\\'\\)" | |
918 old) | |
919 (if (match-beginning 1) | |
920 (setq new (concat new "[^\n\r]*[\n\r]")) | |
921 (setq new (concat new "[^\n\r]*" (match-string 3 old)))) | |
922 (setq old (substring old (match-end 0)))) | |
923 new)) | |
924 | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
925 ;; Auto recentering of TOC window |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
926 |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
927 (defun reftex-recenter-toc-when-idle () |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
928 (and (> (buffer-size) 5) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
929 reftex-mode |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
930 (not (active-minibuffer-window)) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
931 (fboundp 'reftex-toc-mode) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
932 (get-buffer-window "*toc*" 'visible) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
933 (string= reftex-last-toc-master (reftex-TeX-master-file)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
934 (let (current-prefix-arg) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
935 (reftex-toc-recenter)))) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
936 |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
937 (defun reftex-toggle-auto-toc-recenter () |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
938 "Toggle the automatic recentering of the toc window. |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
939 When active, leaving point idle will make the toc window jump to the correct |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
940 section." |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
941 (interactive) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
942 (if reftex-toc-auto-recenter-timer |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
943 (progn |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
944 (if (featurep 'xemacs) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
945 (delete-itimer reftex-toc-auto-recenter-timer) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
946 (cancel-timer reftex-toc-auto-recenter-timer)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
947 (setq reftex-toc-auto-recenter-timer nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
948 (message "Automatic recentering of toc windwo was turned off")) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
949 (setq reftex-toc-auto-recenter-timer |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
950 (if (featurep 'xemacs) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
951 (start-itimer "RefTeX Idle Timer for recenter" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
952 'reftex-recenter-toc-when-idle |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
953 reftex-idle-time reftex-idle-time t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
954 (run-with-idle-timer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
955 reftex-idle-time t 'reftex-recenter-toc-when-idle))) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
956 (message "Automatic recentering of toc window was turned on"))) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
957 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
958 (defun reftex-toc-toggle-dedicated-frame () |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
959 "Toggle the display of a separate frame for the TOC. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
960 This frame is not used by the `reftex-toc' commands, but it is useful to |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
961 always show the current section in connection with the option |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
962 `reftex-auto-recenter-toc'." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
963 (interactive) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
964 (catch 'exit |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
965 (let* ((frames (frame-list)) frame |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
966 (get-frame-prop-func (if (fboundp 'frame-property) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
967 'frame-property |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
968 'frame-parameter))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
969 (while (setq frame (pop frames)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
970 (if (equal (funcall get-frame-prop-func frame 'name) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
971 "RefTeX TOC Frame") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
972 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
973 (delete-frame frame) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
974 (throw 'exit nil)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
975 (reftex-make-separate-toc-frame)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
976 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
977 (defun reftex-make-separate-toc-frame () |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
978 ;; Create a new fame showing only the toc buffer. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
979 (let ((current-frame (selected-frame)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
980 (current-window (selected-window)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
981 (current-toc-window (get-buffer-window "*toc*" 'visible)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
982 current-toc-frame) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
983 (if (and current-toc-window |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
984 (not (equal (selected-frame) (window-frame current-toc-window)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
985 nil |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
986 (setq current-toc-frame |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
987 (make-frame |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
988 '((name . "RefTeX TOC Frame") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
989 (height . 20) (width . 60) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
990 (unsplittable . t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
991 (minibuffer . nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
992 (default-toolbar-visible-p . nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
993 (menubar-visible-p . nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
994 (horizontal-scrollbar-visible-p . nil)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
995 (select-frame current-toc-frame) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
996 (switch-to-buffer "*toc*") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
997 (select-frame current-frame) |
87633
2b38ed4ed1bb
Ralf Angeli <angeli at caeruleus.net>
Glenn Morris <rgm@gnu.org>
parents:
87170
diff
changeset
|
998 (cond ((fboundp 'x-focus-frame) |
2b38ed4ed1bb
Ralf Angeli <angeli at caeruleus.net>
Glenn Morris <rgm@gnu.org>
parents:
87170
diff
changeset
|
999 (x-focus-frame current-frame)) |
2b38ed4ed1bb
Ralf Angeli <angeli at caeruleus.net>
Glenn Morris <rgm@gnu.org>
parents:
87170
diff
changeset
|
1000 ((and (featurep 'xemacs) ; `focus-frame' is a nop in Emacs. |
2b38ed4ed1bb
Ralf Angeli <angeli at caeruleus.net>
Glenn Morris <rgm@gnu.org>
parents:
87170
diff
changeset
|
1001 (fboundp 'focus-frame)) |
2b38ed4ed1bb
Ralf Angeli <angeli at caeruleus.net>
Glenn Morris <rgm@gnu.org>
parents:
87170
diff
changeset
|
1002 (focus-frame current-frame))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1003 (select-window current-window) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1004 (when (eq reftex-auto-recenter-toc 'frame) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1005 (unless reftex-toc-auto-recenter-timer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1006 (reftex-toggle-auto-toc-recenter)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1007 (add-hook 'delete-frame-hook 'reftex-toc-delete-frame-hook))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1008 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1009 (defun reftex-toc-delete-frame-hook (frame) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1010 (if (and reftex-toc-auto-recenter-timer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1011 (reftex-toc-dframe-p frame)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1012 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1013 (reftex-toggle-auto-toc-recenter)))) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
1014 |
25280 | 1015 ;; Table of Contents map |
1016 (define-key reftex-toc-map (if (featurep 'xemacs) [(button2)] [(mouse-2)]) | |
1017 'reftex-toc-mouse-goto-line-and-hide) | |
69227
6c1428d2666e
(reftex-toc-map): Fixed typo,
Carsten Dominik <dominik@science.uva.nl>
parents:
69178
diff
changeset
|
1018 (define-key reftex-toc-map [follow-link] 'mouse-face) |
25280 | 1019 |
1020 (substitute-key-definition | |
1021 'next-line 'reftex-toc-next reftex-toc-map global-map) | |
1022 (substitute-key-definition | |
1023 'previous-line 'reftex-toc-previous reftex-toc-map global-map) | |
1024 | |
1025 (loop for x in | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1026 '(("n" . reftex-toc-next) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1027 ("p" . reftex-toc-previous) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1028 ("?" . reftex-toc-show-help) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1029 (" " . reftex-toc-view-line) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1030 ("\C-m" . reftex-toc-goto-line-and-hide) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1031 ("\C-i" . reftex-toc-goto-line) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1032 ("\C-c>" . reftex-toc-display-index) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1033 ("r" . reftex-toc-rescan) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1034 ("R" . reftex-toc-Rescan) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1035 ("g" . revert-buffer) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1036 ("q" . reftex-toc-quit); |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1037 ("k" . reftex-toc-quit-and-kill) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1038 ("f" . reftex-toc-toggle-follow); |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1039 ("a" . reftex-toggle-auto-toc-recenter) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1040 ("d" . reftex-toc-toggle-dedicated-frame) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1041 ("F" . reftex-toc-toggle-file-boundary) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1042 ("i" . reftex-toc-toggle-index) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1043 ("l" . reftex-toc-toggle-labels) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1044 ("t" . reftex-toc-max-level) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1045 ("c" . reftex-toc-toggle-context) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1046 ; ("%" . reftex-toc-toggle-commented) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1047 ("\M-%" . reftex-toc-rename-label) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1048 ("x" . reftex-toc-external) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1049 ("z" . reftex-toc-jump) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1050 ("." . reftex-toc-show-calling-point) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1051 ("\C-c\C-n" . reftex-toc-next-heading) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1052 ("\C-c\C-p" . reftex-toc-previous-heading) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1053 (">" . reftex-toc-demote) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1054 ("<" . reftex-toc-promote)) |
25280 | 1055 do (define-key reftex-toc-map (car x) (cdr x))) |
1056 | |
1057 (loop for key across "0123456789" do | |
1058 (define-key reftex-toc-map (vector (list key)) 'digit-argument)) | |
1059 (define-key reftex-toc-map "-" 'negative-argument) | |
1060 | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
1061 (easy-menu-define |
25280 | 1062 reftex-toc-menu reftex-toc-map |
1063 "Menu for Table of Contents buffer" | |
1064 '("TOC" | |
1065 ["Show Location" reftex-toc-view-line t] | |
1066 ["Go To Location" reftex-toc-goto-line t] | |
1067 ["Exit & Go To Location" reftex-toc-goto-line-and-hide t] | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1068 ["Show Calling Point" reftex-toc-show-calling-point t] |
25280 | 1069 ["Quit" reftex-toc-quit t] |
1070 "--" | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1071 ("Edit" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1072 ["Promote" reftex-toc-promote t] |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1073 ["Demote" reftex-toc-demote t] |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1074 ["Rename Label" reftex-toc-rename-label t]) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1075 "--" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1076 ["Index" reftex-toc-display-index t] |
25280 | 1077 ["External Document TOC " reftex-toc-external t] |
1078 "--" | |
1079 ("Update" | |
34402
5eec8d1d09f0
Update to RefTeX 4.15, see ChangeLog for details
Carsten Dominik <dominik@science.uva.nl>
parents:
34211
diff
changeset
|
1080 ["Rebuilt *toc* Buffer" revert-buffer t] |
25280 | 1081 ["Rescan One File" reftex-toc-rescan reftex-enable-partial-scans] |
1082 ["Rescan Entire Document" reftex-toc-Rescan t]) | |
1083 ("Options" | |
1084 "TOC Items" | |
1085 ["File Boundaries" reftex-toc-toggle-file-boundary :style toggle | |
1086 :selected reftex-toc-include-file-boundaries] | |
1087 ["Labels" reftex-toc-toggle-labels :style toggle | |
1088 :selected reftex-toc-include-labels] | |
1089 ["Index Entries" reftex-toc-toggle-index :style toggle | |
1090 :selected reftex-toc-include-index-entries] | |
1091 ["Context" reftex-toc-toggle-context :style toggle | |
1092 :selected reftex-toc-include-context] | |
1093 "--" | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
65270
diff
changeset
|
1094 ["Follow Mode" reftex-toc-toggle-follow :style toggle |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1095 :selected reftex-toc-follow-mode] |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1096 ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1097 :selected reftex-toc-auto-recenter-timer] |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50979
diff
changeset
|
1098 ["Dedicated Frame" reftex-toc-toggle-dedicated-frame t]) |
25280 | 1099 "--" |
1100 ["Help" reftex-toc-show-help t])) | |
1101 | |
1102 | |
52401 | 1103 ;;; arch-tag: 92400ce2-0b86-4c89-a606-4ed71acea17e |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
53852
diff
changeset
|
1104 ;;; reftex-toc.el ends here |