Mercurial > emacs
comparison lisp/textmodes/reftex-toc.el @ 90228:fa0da9b57058
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-82
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 542-553)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 116-121)
- Merge from emacs--cvs-trunk--0
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 19 Sep 2005 10:20:33 +0000 |
parents | a3716f7538f2 253cad16882d |
children | ee12d75eb214 |
comparison
equal
deleted
inserted
replaced
90227:10fe5fadaf89 | 90228:fa0da9b57058 |
---|---|
1 ;;; reftex-toc.el --- RefTeX's table of contents mode | 1 ;;; reftex-toc.el --- RefTeX's table of contents mode |
2 | 2 ;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005 |
3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, | 3 ;; Free Software Foundation, Inc. |
4 ;; 2005 Free Software Foundation, Inc. | |
5 | 4 |
6 ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 ;; Author: Carsten Dominik <dominik@science.uva.nl> |
7 ;; Version: 4.28 | 6 ;; Version: VERSIONTAG |
8 | 7 |
9 ;; This file is part of GNU Emacs. | 8 ;; This file is part of GNU Emacs. |
10 | 9 |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | 10 ;; 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 | 11 ;; it under the terms of the GNU General Public License as published by |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 ;; GNU General Public License for more details. | 18 ;; GNU General Public License for more details. |
20 | 19 |
21 ;; You should have received a copy of the GNU General Public License | 20 ;; 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 | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
24 ;; Boston, MA 02110-1301, USA. | 23 ;; Boston, MA 02111-1307, USA. |
25 | 24 |
26 ;;; Commentary: | 25 ;;; Commentary: |
27 | 26 |
28 ;;; Code: | 27 ;;; Code: |
29 | 28 |
34 | 33 |
35 (defvar reftex-toc-map (make-sparse-keymap) | 34 (defvar reftex-toc-map (make-sparse-keymap) |
36 "Keymap used for *toc* buffer.") | 35 "Keymap used for *toc* buffer.") |
37 | 36 |
38 (defvar reftex-toc-menu) | 37 (defvar reftex-toc-menu) |
39 (defvar zmacs-regions) | 38 (eval-when-compile (defvar zmacs-regions)) |
40 | 39 (defvar reftex-last-window-height nil) |
40 (defvar reftex-last-window-width nil) | |
41 (defvar reftex-toc-include-labels-indicator nil) | 41 (defvar reftex-toc-include-labels-indicator nil) |
42 (defvar reftex-toc-include-index-indicator nil) | 42 (defvar reftex-toc-include-index-indicator nil) |
43 (defvar reftex-toc-max-level-indicator nil) | 43 (defvar reftex-toc-max-level-indicator nil) |
44 | 44 |
45 (defun reftex-toc-mode () | 45 (defun reftex-toc-mode () |
77 (make-local-hook 'pre-command-hook)) | 77 (make-local-hook 'pre-command-hook)) |
78 (make-local-variable 'reftex-last-follow-point) | 78 (make-local-variable 'reftex-last-follow-point) |
79 (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t) | 79 (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t) |
80 (add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t) | 80 (add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t) |
81 (easy-menu-add reftex-toc-menu reftex-toc-map) | 81 (easy-menu-add reftex-toc-menu reftex-toc-map) |
82 (run-mode-hooks 'reftex-toc-mode-hook)) | 82 (run-hooks 'reftex-toc-mode-hook)) |
83 | 83 |
84 (defvar reftex-last-toc-file nil | 84 (defvar reftex-last-toc-file nil |
85 "Stores the file name from which `reftex-toc' was called. For redo command.") | 85 "Stores the file name from which `reftex-toc' was called. For redo command.") |
86 | 86 |
87 (defvar reftex-last-window-height nil) | |
88 (defvar reftex-last-window-width nil) | |
89 | 87 |
90 (defvar reftex-toc-return-marker (make-marker) | 88 (defvar reftex-toc-return-marker (make-marker) |
91 "Marker which makes it possible to return from toc to old position.") | 89 "Marker which makes it possible to return from toc to old position.") |
92 | 90 |
93 (defconst reftex-toc-help | 91 (defconst reftex-toc-help |
150 (unsplittable (if (fboundp 'frame-property) | 148 (unsplittable (if (fboundp 'frame-property) |
151 (frame-property (selected-frame) 'unsplittable) | 149 (frame-property (selected-frame) 'unsplittable) |
152 (frame-parameter (selected-frame) 'unsplittable))) | 150 (frame-parameter (selected-frame) 'unsplittable))) |
153 offset toc-window) | 151 offset toc-window) |
154 | 152 |
155 (if (setq toc-window (get-buffer-window | 153 (if (setq toc-window (get-buffer-window |
156 "*toc*" | 154 "*toc*" |
157 (if reuse 'visible))) | 155 (if reuse 'visible))) |
158 (select-window toc-window) | 156 (select-window toc-window) |
159 (when (or (not reftex-toc-keep-other-windows) | 157 (when (or (not reftex-toc-keep-other-windows) |
160 (< (window-height) (* 2 window-min-height))) | 158 (< (window-height) (* 2 window-min-height))) |
166 (unless unsplittable | 164 (unless unsplittable |
167 (if reftex-toc-split-windows-horizontally | 165 (if reftex-toc-split-windows-horizontally |
168 (split-window-horizontally | 166 (split-window-horizontally |
169 (floor (* (window-width) | 167 (floor (* (window-width) |
170 reftex-toc-split-windows-fraction))) | 168 reftex-toc-split-windows-fraction))) |
171 (split-window-vertically | 169 (split-window-vertically |
172 (floor (* (window-height) | 170 (floor (* (window-height) |
173 reftex-toc-split-windows-fraction))))) | 171 reftex-toc-split-windows-fraction))))) |
174 | 172 |
175 (let ((default-major-mode 'reftex-toc-mode)) | 173 (let ((default-major-mode 'reftex-toc-mode)) |
176 (switch-to-buffer "*toc*"))) | 174 (switch-to-buffer "*toc*"))) |
211 reftex-toc-include-index-entries | 209 reftex-toc-include-index-entries |
212 reftex-toc-include-file-boundaries | 210 reftex-toc-include-file-boundaries |
213 reftex-toc-include-context | 211 reftex-toc-include-context |
214 nil ; counter | 212 nil ; counter |
215 nil ; commented | 213 nil ; commented |
216 here-I-am | 214 here-I-am |
217 "" ; xr-prefix | 215 "" ; xr-prefix |
218 t ; a toc buffer | 216 t ; a toc buffer |
219 )) | 217 )) |
220 | 218 |
221 (run-hooks 'reftex-display-copied-context-hook) | 219 (run-hooks 'reftex-display-copied-context-hook) |
222 (message "Building *toc* buffer...done.") | 220 (message "Building *toc* buffer...done.") |
223 (setq buffer-read-only t)) | 221 (setq buffer-read-only t)) |
224 (t | 222 (t |
225 ;; Only compute the offset | 223 ;; Only compute the offset |
227 (or (reftex-get-offset this-buf here-I-am | 225 (or (reftex-get-offset this-buf here-I-am |
228 (if reftex-toc-include-labels " " nil) | 226 (if reftex-toc-include-labels " " nil) |
229 t | 227 t |
230 reftex-toc-include-index-entries | 228 reftex-toc-include-index-entries |
231 reftex-toc-include-file-boundaries) | 229 reftex-toc-include-file-boundaries) |
232 (reftex-last-assoc-before-elt | 230 (reftex-last-assoc-before-elt |
233 'toc here-I-am | 231 'toc here-I-am |
234 (symbol-value reftex-docstruct-symbol)))) | 232 (symbol-value reftex-docstruct-symbol)))) |
235 (put 'reftex-toc :reftex-line 3) | 233 (put 'reftex-toc :reftex-line 3) |
236 (goto-line 3) | 234 (goto-line 3) |
237 (beginning-of-line))) | 235 (beginning-of-line))) |
252 (reftex-toc nil t))) | 250 (reftex-toc nil t))) |
253 (and (> (point) 1) | 251 (and (> (point) 1) |
254 (not (get-text-property (point) 'intangible)) | 252 (not (get-text-property (point) 'intangible)) |
255 (memq reftex-highlight-selection '(cursor both)) | 253 (memq reftex-highlight-selection '(cursor both)) |
256 (reftex-highlight 2 | 254 (reftex-highlight 2 |
257 (or (previous-single-property-change | 255 (or (previous-single-property-change |
258 (min (point-max) (1+ (point))) :data) | 256 (min (point-max) (1+ (point))) :data) |
259 (point-min)) | 257 (point-min)) |
260 (or (next-single-property-change (point) :data) | 258 (or (next-single-property-change (point) :data) |
261 (point-max)))) | 259 (point-max)))) |
262 (select-window (get-buffer-window buf frame)))) | 260 (select-window (get-buffer-window buf frame)))) |
299 (enlarge-window | 297 (enlarge-window |
300 (max 0 (- (or reftex-last-window-height (window-height)) | 298 (max 0 (- (or reftex-last-window-height (window-height)) |
301 (window-height)))))) | 299 (window-height)))))) |
302 | 300 |
303 (defun reftex-toc-dframe-p (&optional frame error) | 301 (defun reftex-toc-dframe-p (&optional frame error) |
304 ;; Check if FRAME is the dedicated TOC frame. | 302 ;; Check if FRAME is the dedicated TOC frame. |
305 ;; If yes, and ERROR is non-nil, throw an error. | 303 ;; If yes, and ERROR is non-nil, throw an error. |
306 (setq frame (or frame (selected-frame))) | 304 (setq frame (or frame (selected-frame))) |
307 (let ((res (equal | 305 (let ((res (equal |
308 (if (fboundp 'frame-property) | 306 (if (fboundp 'frame-property) |
309 (frame-property frame 'name) | 307 (frame-property frame 'name) |
310 (frame-parameter frame 'name)) | 308 (frame-parameter frame 'name)) |
311 "RefTeX TOC Frame"))) | 309 "RefTeX TOC Frame"))) |
312 (if (and res error) | 310 (if (and res error) |
328 "Move to next selectable item." | 326 "Move to next selectable item." |
329 (interactive "p") | 327 (interactive "p") |
330 (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t)) | 328 (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t)) |
331 (setq reftex-callback-fwd t) | 329 (setq reftex-callback-fwd t) |
332 (or (eobp) (forward-char 1)) | 330 (or (eobp) (forward-char 1)) |
333 (goto-char (or (next-single-property-change (point) :data) | 331 (goto-char (or (next-single-property-change (point) :data) |
334 (point)))) | 332 (point)))) |
335 (defun reftex-toc-previous (&optional arg) | 333 (defun reftex-toc-previous (&optional arg) |
336 "Move to previous selectable item." | 334 "Move to previous selectable item." |
337 (interactive "p") | 335 (interactive "p") |
338 (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t)) | 336 (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t)) |
365 (defun reftex-toc-toggle-labels (arg) | 363 (defun reftex-toc-toggle-labels (arg) |
366 "Toggle inclusion of labels in *toc* buffer. | 364 "Toggle inclusion of labels in *toc* buffer. |
367 With prefix ARG, prompt for a label type and include only labels of | 365 With prefix ARG, prompt for a label type and include only labels of |
368 that specific type." | 366 that specific type." |
369 (interactive "P") | 367 (interactive "P") |
370 (setq reftex-toc-include-labels | 368 (setq reftex-toc-include-labels |
371 (if arg (reftex-query-label-type) | 369 (if arg (reftex-query-label-type) |
372 (not reftex-toc-include-labels))) | 370 (not reftex-toc-include-labels))) |
373 (reftex-toc-revert)) | 371 (reftex-toc-revert)) |
374 (defun reftex-toc-toggle-index (arg) | 372 (defun reftex-toc-toggle-index (arg) |
375 "Toggle inclusion of index in *toc* buffer. | 373 "Toggle inclusion of index in *toc* buffer. |
469 | 467 |
470 ;; Rescanning the document and rebuilding the TOC buffer. | 468 ;; Rescanning the document and rebuilding the TOC buffer. |
471 (defun reftex-toc-rescan (&rest ignore) | 469 (defun reftex-toc-rescan (&rest ignore) |
472 "Regenerate the *toc* buffer by reparsing file of section at point." | 470 "Regenerate the *toc* buffer by reparsing file of section at point." |
473 (interactive) | 471 (interactive) |
474 (if (and reftex-enable-partial-scans | 472 (if (and reftex-enable-partial-scans |
475 (null current-prefix-arg)) | 473 (null current-prefix-arg)) |
476 (let* ((data (get-text-property (point) :data)) | 474 (let* ((data (get-text-property (point) :data)) |
477 (what (car data)) | 475 (what (car data)) |
478 (file (cond ((eq what 'toc) (nth 3 data)) | 476 (file (cond ((eq what 'toc) (nth 3 data)) |
479 ((memq what '(eof bof file-error)) (nth 1 data)) | 477 ((memq what '(eof bof file-error)) (nth 1 data)) |
503 (reftex-toc))) | 501 (reftex-toc))) |
504 | 502 |
505 (defun reftex-toc-revert (&rest ignore) | 503 (defun reftex-toc-revert (&rest ignore) |
506 "Regenerate the *toc* from the internal lists." | 504 "Regenerate the *toc* from the internal lists." |
507 (interactive) | 505 (interactive) |
508 (let ((unsplittable | 506 (let ((unsplittable |
509 (if (fboundp 'frame-property) | 507 (if (fboundp 'frame-property) |
510 (frame-property (selected-frame) 'unsplittable) | 508 (frame-property (selected-frame) 'unsplittable) |
511 (frame-parameter (selected-frame) 'unsplittable))) | 509 (frame-parameter (selected-frame) 'unsplittable))) |
512 (reftex-rebuilding-toc t)) | 510 (reftex-rebuilding-toc t)) |
513 (if unsplittable | 511 (if unsplittable |
544 (concat "^ *" (number-to-string (if (numberp arg) arg 1)) " ") | 542 (concat "^ *" (number-to-string (if (numberp arg) arg 1)) " ") |
545 nil t) | 543 nil t) |
546 (beginning-of-line)) | 544 (beginning-of-line)) |
547 | 545 |
548 ;; Promotion/Demotion stuff | 546 ;; Promotion/Demotion stuff |
547 | |
548 (defvar delta) | |
549 (defvar mpos) | |
550 (defvar pro-or-de) | |
551 (defvar start-pos) | |
552 (defvar start-line) | |
553 (defvar mark-line) | |
549 | 554 |
550 (defun reftex-toc-demote (&optional arg) | 555 (defun reftex-toc-demote (&optional arg) |
551 "Demote section at point. If region is active, apply to all in region." | 556 "Demote section at point. If region is active, apply to all in region." |
552 (interactive "p") | 557 (interactive "p") |
553 (reftex-toc-do-promote 1)) | 558 (reftex-toc-do-promote 1)) |
590 (setq entries (nreverse entries)) | 595 (setq entries (nreverse entries)) |
591 ;; Get the relevant section numbers, for an informative message | 596 ;; Get the relevant section numbers, for an informative message |
592 (goto-char start-pos) | 597 (goto-char start-pos) |
593 (setq sections (reftex-toc-extract-section-number (car entries))) | 598 (setq sections (reftex-toc-extract-section-number (car entries))) |
594 (if (> (setq nsec (length entries)) 1) | 599 (if (> (setq nsec (length entries)) 1) |
595 (setq sections | 600 (setq sections |
596 (concat sections "-" | 601 (concat sections "-" |
597 (reftex-toc-extract-section-number | 602 (reftex-toc-extract-section-number |
598 (nth (1- nsec) entries))))) | 603 (nth (1- nsec) entries))))) |
599 ;; Run through the list and prepare the changes. | 604 ;; Run through the list and prepare the changes. |
600 (setq entries (mapcar 'reftex-toc-promote-prepare entries)) | 605 (setq entries (mapcar 'reftex-toc-promote-prepare entries)) |
615 (mapcar 'reftex-toc-promote-action entries) | 620 (mapcar 'reftex-toc-promote-action entries) |
616 ;; Rescan the document and rebuilt the toc buffer | 621 ;; Rescan the document and rebuilt the toc buffer |
617 (save-window-excursion | 622 (save-window-excursion |
618 (reftex-toc-Rescan)) | 623 (reftex-toc-Rescan)) |
619 (reftex-toc-restore-region start-line mark-line) | 624 (reftex-toc-restore-region start-line mark-line) |
620 (message "%d section%s %smoted" | 625 (message "%d section%s %smoted" |
621 nsec (if (= 1 nsec) "" "s") pro-or-de) | 626 nsec (if (= 1 nsec) "" "s") pro-or-de) |
622 nil)) | 627 nil)) |
623 (if msg (progn (ding) (message msg))))) | 628 (if msg (progn (ding) (message msg))))) |
624 | 629 |
625 (defvar delta) | |
626 (defvar mpos) | |
627 (defvar pro-or-de) | |
628 (defvar start-pos) | |
629 (defvar start-line) | |
630 (defvar mark-line) | |
631 | 630 |
632 (defun reftex-toc-restore-region (point-line &optional mark-line) | 631 (defun reftex-toc-restore-region (point-line &optional mark-line) |
633 (if mark-line | 632 (if mark-line |
634 (progn (goto-line mark-line) | 633 (progn (goto-line mark-line) |
635 (setq mpos (point)))) | 634 (setq mpos (point)))) |
639 (set-mark mpos) | 638 (set-mark mpos) |
640 (if (fboundp 'zmacs-activate-region) | 639 (if (fboundp 'zmacs-activate-region) |
641 (zmacs-activate-region) | 640 (zmacs-activate-region) |
642 (setq mark-active t | 641 (setq mark-active t |
643 deactivate-mark nil))))) | 642 deactivate-mark nil))))) |
643 | |
644 (defvar name1) | |
645 (defvar dummy) | |
646 (defvar dummy2) | |
644 | 647 |
645 (defun reftex-toc-promote-prepare (x) | 648 (defun reftex-toc-promote-prepare (x) |
646 "Look at a toc entry and see if we could pro/demote it. | 649 "Look at a toc entry and see if we could pro/demote it. |
647 Expects the level change DELTA to be dynamically scoped into this function. | 650 Expects the level change DELTA to be dynamically scoped into this function. |
648 This function prepares everything for the changes, but does not do it. | 651 This function prepares everything for the changes, but does not do it. |
668 ;; OK, get the makro name | 671 ;; OK, get the makro name |
669 (progn | 672 (progn |
670 (beginning-of-line 1) | 673 (beginning-of-line 1) |
671 (if (looking-at reftex-section-regexp) | 674 (if (looking-at reftex-section-regexp) |
672 (setq name (reftex-match-string 2)) | 675 (setq name (reftex-match-string 2)) |
673 (error "Something is wrong! Contact maintainer!"))) | 676 (error "Something is wrong! Contact maintainer!"))) |
674 ;; Section has changed, request scan and loading | 677 ;; Section has changed, request scan and loading |
675 ;; We use a variable to delay until after the safe-exc. | 678 ;; We use a variable to delay until after the safe-exc. |
676 ;; because otherwise we loose the region. | 679 ;; because otherwise we loose the region. |
677 (setq load t))) | 680 (setq load t))) |
678 ;; Scan document and load all files, this exits command | 681 ;; Scan document and load all files, this exits command |
777 (label (car toc)) newlabel) | 780 (label (car toc)) newlabel) |
778 (if (not (stringp label)) | 781 (if (not (stringp label)) |
779 (error "This is not a label entry.")) | 782 (error "This is not a label entry.")) |
780 (setq newlabel (read-string (format "Rename label \"%s\" to:" label))) | 783 (setq newlabel (read-string (format "Rename label \"%s\" to:" label))) |
781 (if (assoc newlabel (symbol-value reftex-docstruct-symbol)) | 784 (if (assoc newlabel (symbol-value reftex-docstruct-symbol)) |
782 (if (not (y-or-n-p | 785 (if (not (y-or-n-p |
783 (format "Label '%s' exists. Use anyway? " label))) | 786 (format "Label '%s' exists. Use anyway? " label))) |
784 (error "Abort"))) | 787 (error "Abort"))) |
785 (save-excursion | 788 (save-excursion |
786 (save-window-excursion | 789 (save-window-excursion |
787 (reftex-toc-visit-location t) | 790 (reftex-toc-visit-location t) |
788 (condition-case nil | 791 (condition-case nil |
789 (reftex-query-replace-document | 792 (reftex-query-replace-document |
790 (concat "{" (regexp-quote label) "}") | 793 (concat "{" (regexp-quote label) "}") |
791 (format "{%s}" newlabel)) | 794 (format "{%s}" newlabel)) |
792 (error t)))) | 795 (error t)))) |
793 (reftex-toc-rescan))) | 796 (reftex-toc-rescan))) |
794 | 797 |
795 | 798 |
796 (defun reftex-toc-visit-location (&optional final no-revisit) | 799 (defun reftex-toc-visit-location (&optional final no-revisit) |
797 ;; Visit the tex file corresponding to the toc entry on the current line. | 800 ;; Visit the tex file corresponding to the toc entry on the current line. |
806 (let* ((toc (get-text-property (point) :data)) | 809 (let* ((toc (get-text-property (point) :data)) |
807 (toc-window (selected-window)) | 810 (toc-window (selected-window)) |
808 show-window show-buffer match) | 811 show-window show-buffer match) |
809 | 812 |
810 (unless toc (error "Don't know which toc line to visit")) | 813 (unless toc (error "Don't know which toc line to visit")) |
811 | 814 |
812 (cond | 815 (cond |
813 | 816 |
814 ((eq (car toc) 'toc) | 817 ((eq (car toc) 'toc) |
815 ;; a toc entry | 818 ;; a toc entry |
816 (setq match (reftex-toc-find-section toc no-revisit))) | 819 (setq match (reftex-toc-find-section toc no-revisit))) |
817 | 820 |
818 ((eq (car toc) 'index) | 821 ((eq (car toc) 'index) |
824 (setq match | 827 (setq match |
825 (let ((where (car toc)) | 828 (let ((where (car toc)) |
826 (file (nth 1 toc))) | 829 (file (nth 1 toc))) |
827 (if (or (not no-revisit) (reftex-get-buffer-visiting file)) | 830 (if (or (not no-revisit) (reftex-get-buffer-visiting file)) |
828 (progn | 831 (progn |
829 (switch-to-buffer-other-window | 832 (switch-to-buffer-other-window |
830 (reftex-get-file-buffer-force file nil)) | 833 (reftex-get-file-buffer-force file nil)) |
831 (goto-char (if (eq where 'bof) (point-min) (point-max)))) | 834 (goto-char (if (eq where 'bof) (point-min) (point-max)))) |
832 (message reftex-no-follow-message) nil)))) | 835 (message reftex-no-follow-message) nil)))) |
833 | 836 |
834 ((stringp (car toc)) | 837 ((stringp (car toc)) |
877 (or (looking-at (regexp-quote literal)) | 880 (or (looking-at (regexp-quote literal)) |
878 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal)) | 881 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal)) |
879 (looking-at (reftex-make-desperate-section-regexp literal)) | 882 (looking-at (reftex-make-desperate-section-regexp literal)) |
880 (looking-at (concat "\\\\" | 883 (looking-at (concat "\\\\" |
881 (regexp-quote | 884 (regexp-quote |
882 (car | 885 (car |
883 (rassq level | 886 (rassq level |
884 reftex-section-levels-all))) | 887 reftex-section-levels-all))) |
885 "[[{]?")))) | 888 "[[{]?")))) |
886 ((or (not no-revisit) | 889 ((or (not no-revisit) |
887 (reftex-get-buffer-visiting file)) | 890 (reftex-get-buffer-visiting file)) |
888 ;; Marker is lost. Use the backup method. | 891 ;; Marker is lost. Use the backup method. |
1048 | 1051 |
1049 (loop for key across "0123456789" do | 1052 (loop for key across "0123456789" do |
1050 (define-key reftex-toc-map (vector (list key)) 'digit-argument)) | 1053 (define-key reftex-toc-map (vector (list key)) 'digit-argument)) |
1051 (define-key reftex-toc-map "-" 'negative-argument) | 1054 (define-key reftex-toc-map "-" 'negative-argument) |
1052 | 1055 |
1053 (easy-menu-define | 1056 (easy-menu-define |
1054 reftex-toc-menu reftex-toc-map | 1057 reftex-toc-menu reftex-toc-map |
1055 "Menu for Table of Contents buffer" | 1058 "Menu for Table of Contents buffer" |
1056 '("TOC" | 1059 '("TOC" |
1057 ["Show Location" reftex-toc-view-line t] | 1060 ["Show Location" reftex-toc-view-line t] |
1058 ["Go To Location" reftex-toc-goto-line t] | 1061 ["Go To Location" reftex-toc-goto-line t] |
1081 ["Index Entries" reftex-toc-toggle-index :style toggle | 1084 ["Index Entries" reftex-toc-toggle-index :style toggle |
1082 :selected reftex-toc-include-index-entries] | 1085 :selected reftex-toc-include-index-entries] |
1083 ["Context" reftex-toc-toggle-context :style toggle | 1086 ["Context" reftex-toc-toggle-context :style toggle |
1084 :selected reftex-toc-include-context] | 1087 :selected reftex-toc-include-context] |
1085 "--" | 1088 "--" |
1086 ["Follow Mode" reftex-toc-toggle-follow :style toggle | 1089 ["Follow Mode" reftex-toc-toggle-follow :style toggle |
1087 :selected reftex-toc-follow-mode] | 1090 :selected reftex-toc-follow-mode] |
1088 ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle | 1091 ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle |
1089 :selected reftex-toc-auto-recenter-timer] | 1092 :selected reftex-toc-auto-recenter-timer] |
1090 ["Dedicated Frame" reftex-toc-toggle-dedicated-frame t]) | 1093 ["Dedicated Frame" reftex-toc-toggle-dedicated-frame t]) |
1091 "--" | 1094 "--" |