comparison lisp/textmodes/reftex-toc.el @ 49599:5ade352e8d1c

Trailing whitespace deleted.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 04 Feb 2003 13:30:45 +0000
parents 904fd28be439
children 85e525daebfc d7ddb3e565de
comparison
equal deleted inserted replaced
49598:0d8b17d428b5 49599:5ade352e8d1c
189 reftex-toc-include-index-entries 189 reftex-toc-include-index-entries
190 reftex-toc-include-file-boundaries 190 reftex-toc-include-file-boundaries
191 reftex-toc-include-context 191 reftex-toc-include-context
192 nil ; counter 192 nil ; counter
193 nil ; commented 193 nil ; commented
194 here-I-am 194 here-I-am
195 "" ; xr-prefix 195 "" ; xr-prefix
196 t ; a toc buffer 196 t ; a toc buffer
197 )) 197 ))
198 198
199 (run-hooks 'reftex-display-copied-context-hook) 199 (run-hooks 'reftex-display-copied-context-hook)
200 (message "Building *toc* buffer...done.") 200 (message "Building *toc* buffer...done.")
201 (setq buffer-read-only t)) 201 (setq buffer-read-only t))
202 (t 202 (t
203 ;; Only compute the offset 203 ;; Only compute the offset
205 (or (reftex-get-offset this-buf here-I-am 205 (or (reftex-get-offset this-buf here-I-am
206 (if reftex-toc-include-labels " " nil) 206 (if reftex-toc-include-labels " " nil)
207 t 207 t
208 reftex-toc-include-index-entries 208 reftex-toc-include-index-entries
209 reftex-toc-include-file-boundaries) 209 reftex-toc-include-file-boundaries)
210 (reftex-last-assoc-before-elt 210 (reftex-last-assoc-before-elt
211 'toc here-I-am 211 'toc here-I-am
212 (symbol-value reftex-docstruct-symbol)))) 212 (symbol-value reftex-docstruct-symbol))))
213 (put 'reftex-toc :reftex-line 3) 213 (put 'reftex-toc :reftex-line 3)
214 (goto-line 3) 214 (goto-line 3)
215 (beginning-of-line))) 215 (beginning-of-line)))
229 (reftex-toc nil))) 229 (reftex-toc nil)))
230 (and (> (point) 1) 230 (and (> (point) 1)
231 (not (get-text-property (point) 'intangible)) 231 (not (get-text-property (point) 'intangible))
232 (memq reftex-highlight-selection '(cursor both)) 232 (memq reftex-highlight-selection '(cursor both))
233 (reftex-highlight 2 233 (reftex-highlight 2
234 (or (previous-single-property-change 234 (or (previous-single-property-change
235 (min (point-max) (1+ (point))) :data) 235 (min (point-max) (1+ (point))) :data)
236 (point-min)) 236 (point-min))
237 (or (next-single-property-change (point) :data) 237 (or (next-single-property-change (point) :data)
238 (point-max)))) 238 (point-max))))
239 (select-window (get-buffer-window buf)))) 239 (select-window (get-buffer-window buf))))
290 (defun reftex-toc-next (&optional arg) 290 (defun reftex-toc-next (&optional arg)
291 "Move to next selectable item." 291 "Move to next selectable item."
292 (interactive "p") 292 (interactive "p")
293 (setq reftex-callback-fwd t) 293 (setq reftex-callback-fwd t)
294 (or (eobp) (forward-char 1)) 294 (or (eobp) (forward-char 1))
295 (goto-char (or (next-single-property-change (point) :data) 295 (goto-char (or (next-single-property-change (point) :data)
296 (point)))) 296 (point))))
297 (defun reftex-toc-previous (&optional arg) 297 (defun reftex-toc-previous (&optional arg)
298 "Move to previous selectable item." 298 "Move to previous selectable item."
299 (interactive "p") 299 (interactive "p")
300 (setq reftex-callback-fwd nil) 300 (setq reftex-callback-fwd nil)
324 (defun reftex-toc-toggle-labels (arg) 324 (defun reftex-toc-toggle-labels (arg)
325 "Toggle inclusion of labels in *toc* buffer. 325 "Toggle inclusion of labels in *toc* buffer.
326 With prefix ARG, prompt for a label type and include only labels of 326 With prefix ARG, prompt for a label type and include only labels of
327 that specific type." 327 that specific type."
328 (interactive "P") 328 (interactive "P")
329 (setq reftex-toc-include-labels 329 (setq reftex-toc-include-labels
330 (if arg (reftex-query-label-type) 330 (if arg (reftex-query-label-type)
331 (not reftex-toc-include-labels))) 331 (not reftex-toc-include-labels)))
332 (reftex-toc-revert)) 332 (reftex-toc-revert))
333 (defun reftex-toc-toggle-index (arg) 333 (defun reftex-toc-toggle-index (arg)
334 "Toggle inclusion of index in *toc* buffer. 334 "Toggle inclusion of index in *toc* buffer.
414 (reftex-toc-goto-line) 414 (reftex-toc-goto-line)
415 (reftex-display-index (if restr nil arg) restr))) 415 (reftex-display-index (if restr nil arg) restr)))
416 (defun reftex-toc-rescan (&rest ignore) 416 (defun reftex-toc-rescan (&rest ignore)
417 "Regenerate the *toc* buffer by reparsing file of section at point." 417 "Regenerate the *toc* buffer by reparsing file of section at point."
418 (interactive) 418 (interactive)
419 (if (and reftex-enable-partial-scans 419 (if (and reftex-enable-partial-scans
420 (null current-prefix-arg)) 420 (null current-prefix-arg))
421 (let* ((data (get-text-property (point) :data)) 421 (let* ((data (get-text-property (point) :data))
422 (what (car data)) 422 (what (car data))
423 (file (cond ((eq what 'toc) (nth 3 data)) 423 (file (cond ((eq what 'toc) (nth 3 data))
424 ((memq what '(eof bof file-error)) (nth 1 data)) 424 ((memq what '(eof bof file-error)) (nth 1 data))
492 (let* ((toc (get-text-property (point) :data)) 492 (let* ((toc (get-text-property (point) :data))
493 (toc-window (selected-window)) 493 (toc-window (selected-window))
494 show-window show-buffer match) 494 show-window show-buffer match)
495 495
496 (unless toc (error "Don't know which toc line to visit")) 496 (unless toc (error "Don't know which toc line to visit"))
497 497
498 (cond 498 (cond
499 499
500 ((eq (car toc) 'toc) 500 ((eq (car toc) 'toc)
501 ;; a toc entry 501 ;; a toc entry
502 (setq match (reftex-toc-find-section toc no-revisit))) 502 (setq match (reftex-toc-find-section toc no-revisit)))
503 503
504 ((eq (car toc) 'index) 504 ((eq (car toc) 'index)
510 (setq match 510 (setq match
511 (let ((where (car toc)) 511 (let ((where (car toc))
512 (file (nth 1 toc))) 512 (file (nth 1 toc)))
513 (if (or (not no-revisit) (reftex-get-buffer-visiting file)) 513 (if (or (not no-revisit) (reftex-get-buffer-visiting file))
514 (progn 514 (progn
515 (switch-to-buffer-other-window 515 (switch-to-buffer-other-window
516 (reftex-get-file-buffer-force file nil)) 516 (reftex-get-file-buffer-force file nil))
517 (goto-char (if (eq where 'bof) (point-min) (point-max)))) 517 (goto-char (if (eq where 'bof) (point-min) (point-max))))
518 (message reftex-no-follow-message) nil)))) 518 (message reftex-no-follow-message) nil))))
519 519
520 ((stringp (car toc)) 520 ((stringp (car toc))
558 (or (looking-at (regexp-quote literal)) 558 (or (looking-at (regexp-quote literal))
559 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal)) 559 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal))
560 (looking-at (reftex-make-desperate-section-regexp literal)) 560 (looking-at (reftex-make-desperate-section-regexp literal))
561 (looking-at (concat "\\\\" 561 (looking-at (concat "\\\\"
562 (regexp-quote 562 (regexp-quote
563 (car 563 (car
564 (rassq level 564 (rassq level
565 reftex-section-levels-all))) 565 reftex-section-levels-all)))
566 "[[{]?")))) 566 "[[{]?"))))
567 ((or (not no-revisit) 567 ((or (not no-revisit)
568 (reftex-get-buffer-visiting file)) 568 (reftex-get-buffer-visiting file))
569 ;; Marker is lost. Use the backup method. 569 ;; Marker is lost. Use the backup method.
670 670
671 (loop for key across "0123456789" do 671 (loop for key across "0123456789" do
672 (define-key reftex-toc-map (vector (list key)) 'digit-argument)) 672 (define-key reftex-toc-map (vector (list key)) 'digit-argument))
673 (define-key reftex-toc-map "-" 'negative-argument) 673 (define-key reftex-toc-map "-" 'negative-argument)
674 674
675 (easy-menu-define 675 (easy-menu-define
676 reftex-toc-menu reftex-toc-map 676 reftex-toc-menu reftex-toc-map
677 "Menu for Table of Contents buffer" 677 "Menu for Table of Contents buffer"
678 '("TOC" 678 '("TOC"
679 ["Show Location" reftex-toc-view-line t] 679 ["Show Location" reftex-toc-view-line t]
680 ["Go To Location" reftex-toc-goto-line t] 680 ["Go To Location" reftex-toc-goto-line t]
697 ["Index Entries" reftex-toc-toggle-index :style toggle 697 ["Index Entries" reftex-toc-toggle-index :style toggle
698 :selected reftex-toc-include-index-entries] 698 :selected reftex-toc-include-index-entries]
699 ["Context" reftex-toc-toggle-context :style toggle 699 ["Context" reftex-toc-toggle-context :style toggle
700 :selected reftex-toc-include-context] 700 :selected reftex-toc-include-context]
701 "--" 701 "--"
702 ["Follow Mode" reftex-toc-toggle-follow :style toggle 702 ["Follow Mode" reftex-toc-toggle-follow :style toggle
703 :selected reftex-toc-follow-mode]) 703 :selected reftex-toc-follow-mode])
704 "--" 704 "--"
705 ["Help" reftex-toc-show-help t])) 705 ["Help" reftex-toc-show-help t]))
706 706
707 707