aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2005-06-14 15:36:08 +0000
committerJuanma Barranquero2005-06-14 15:36:08 +0000
commit52ebd91d1bbeedf4cfdd572c0b8a447c07c33cf7 (patch)
treefac1e533f2ee5cf233484d3092e233e968259935
parent88c31d68c43e8273aa330d2f28535dfa0ccb63de (diff)
downloademacs-52ebd91d1bbeedf4cfdd572c0b8a447c07c33cf7.tar.gz
emacs-52ebd91d1bbeedf4cfdd572c0b8a447c07c33cf7.zip
(reftex-toc-dframe-p, reftex-toc-promote-prepare): Follow error conventions.
-rw-r--r--lisp/textmodes/reftex-toc.el50
1 files changed, 25 insertions, 25 deletions
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index b5edba97f4b..e2c58882d2a 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -149,7 +149,7 @@ When called with a raw C-u prefix, rescan the document first."
149 (frame-parameter (selected-frame) 'unsplittable))) 149 (frame-parameter (selected-frame) 'unsplittable)))
150 offset toc-window) 150 offset toc-window)
151 151
152 (if (setq toc-window (get-buffer-window 152 (if (setq toc-window (get-buffer-window
153 "*toc*" 153 "*toc*"
154 (if reuse 'visible))) 154 (if reuse 'visible)))
155 (select-window toc-window) 155 (select-window toc-window)
@@ -165,7 +165,7 @@ When called with a raw C-u prefix, rescan the document first."
165 (split-window-horizontally 165 (split-window-horizontally
166 (floor (* (window-width) 166 (floor (* (window-width)
167 reftex-toc-split-windows-fraction))) 167 reftex-toc-split-windows-fraction)))
168 (split-window-vertically 168 (split-window-vertically
169 (floor (* (window-height) 169 (floor (* (window-height)
170 reftex-toc-split-windows-fraction))))) 170 reftex-toc-split-windows-fraction)))))
171 171
@@ -210,11 +210,11 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
210 reftex-toc-include-context 210 reftex-toc-include-context
211 nil ; counter 211 nil ; counter
212 nil ; commented 212 nil ; commented
213 here-I-am 213 here-I-am
214 "" ; xr-prefix 214 "" ; xr-prefix
215 t ; a toc buffer 215 t ; a toc buffer
216 )) 216 ))
217 217
218 (run-hooks 'reftex-display-copied-context-hook) 218 (run-hooks 'reftex-display-copied-context-hook)
219 (message "Building *toc* buffer...done.") 219 (message "Building *toc* buffer...done.")
220 (setq buffer-read-only t)) 220 (setq buffer-read-only t))
@@ -226,7 +226,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
226 t 226 t
227 reftex-toc-include-index-entries 227 reftex-toc-include-index-entries
228 reftex-toc-include-file-boundaries) 228 reftex-toc-include-file-boundaries)
229 (reftex-last-assoc-before-elt 229 (reftex-last-assoc-before-elt
230 'toc here-I-am 230 'toc here-I-am
231 (symbol-value reftex-docstruct-symbol)))) 231 (symbol-value reftex-docstruct-symbol))))
232 (put 'reftex-toc :reftex-line 3) 232 (put 'reftex-toc :reftex-line 3)
@@ -251,7 +251,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
251 (not (get-text-property (point) 'intangible)) 251 (not (get-text-property (point) 'intangible))
252 (memq reftex-highlight-selection '(cursor both)) 252 (memq reftex-highlight-selection '(cursor both))
253 (reftex-highlight 2 253 (reftex-highlight 2
254 (or (previous-single-property-change 254 (or (previous-single-property-change
255 (min (point-max) (1+ (point))) :data) 255 (min (point-max) (1+ (point))) :data)
256 (point-min)) 256 (point-min))
257 (or (next-single-property-change (point) :data) 257 (or (next-single-property-change (point) :data)
@@ -298,16 +298,16 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
298 (window-height)))))) 298 (window-height))))))
299 299
300(defun reftex-toc-dframe-p (&optional frame error) 300(defun reftex-toc-dframe-p (&optional frame error)
301 ;; Check if FRAME is the dedicated TOC frame. 301 ;; Check if FRAME is the dedicated TOC frame.
302 ;; If yes, and ERROR is non-nil, throw an error. 302 ;; If yes, and ERROR is non-nil, throw an error.
303 (setq frame (or frame (selected-frame))) 303 (setq frame (or frame (selected-frame)))
304 (let ((res (equal 304 (let ((res (equal
305 (if (fboundp 'frame-property) 305 (if (fboundp 'frame-property)
306 (frame-property frame 'name) 306 (frame-property frame 'name)
307 (frame-parameter frame 'name)) 307 (frame-parameter frame 'name))
308 "RefTeX TOC Frame"))) 308 "RefTeX TOC Frame")))
309 (if (and res error) 309 (if (and res error)
310 (error "This frame is view-only. Use `C-c =' to create toc window for commands.")) 310 (error "This frame is view-only. Use `C-c =' to create toc window for commands"))
311 res)) 311 res))
312 312
313(defun reftex-toc-show-help () 313(defun reftex-toc-show-help ()
@@ -327,7 +327,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
327 (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t)) 327 (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t))
328 (setq reftex-callback-fwd t) 328 (setq reftex-callback-fwd t)
329 (or (eobp) (forward-char 1)) 329 (or (eobp) (forward-char 1))
330 (goto-char (or (next-single-property-change (point) :data) 330 (goto-char (or (next-single-property-change (point) :data)
331 (point)))) 331 (point))))
332(defun reftex-toc-previous (&optional arg) 332(defun reftex-toc-previous (&optional arg)
333 "Move to previous selectable item." 333 "Move to previous selectable item."
@@ -364,7 +364,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
364With prefix ARG, prompt for a label type and include only labels of 364With prefix ARG, prompt for a label type and include only labels of
365that specific type." 365that specific type."
366 (interactive "P") 366 (interactive "P")
367 (setq reftex-toc-include-labels 367 (setq reftex-toc-include-labels
368 (if arg (reftex-query-label-type) 368 (if arg (reftex-query-label-type)
369 (not reftex-toc-include-labels))) 369 (not reftex-toc-include-labels)))
370 (reftex-toc-revert)) 370 (reftex-toc-revert))
@@ -468,7 +468,7 @@ With prefix arg 1, restrict index to the section at point."
468(defun reftex-toc-rescan (&rest ignore) 468(defun reftex-toc-rescan (&rest ignore)
469 "Regenerate the *toc* buffer by reparsing file of section at point." 469 "Regenerate the *toc* buffer by reparsing file of section at point."
470 (interactive) 470 (interactive)
471 (if (and reftex-enable-partial-scans 471 (if (and reftex-enable-partial-scans
472 (null current-prefix-arg)) 472 (null current-prefix-arg))
473 (let* ((data (get-text-property (point) :data)) 473 (let* ((data (get-text-property (point) :data))
474 (what (car data)) 474 (what (car data))
@@ -502,7 +502,7 @@ With prefix arg 1, restrict index to the section at point."
502(defun reftex-toc-revert (&rest ignore) 502(defun reftex-toc-revert (&rest ignore)
503 "Regenerate the *toc* from the internal lists." 503 "Regenerate the *toc* from the internal lists."
504 (interactive) 504 (interactive)
505 (let ((unsplittable 505 (let ((unsplittable
506 (if (fboundp 'frame-property) 506 (if (fboundp 'frame-property)
507 (frame-property (selected-frame) 'unsplittable) 507 (frame-property (selected-frame) 'unsplittable)
508 (frame-parameter (selected-frame) 'unsplittable))) 508 (frame-parameter (selected-frame) 'unsplittable)))
@@ -589,7 +589,7 @@ point."
589 (goto-char start-pos) 589 (goto-char start-pos)
590 (setq sections (reftex-toc-extract-section-number (car entries))) 590 (setq sections (reftex-toc-extract-section-number (car entries)))
591 (if (> (setq nsec (length entries)) 1) 591 (if (> (setq nsec (length entries)) 1)
592 (setq sections 592 (setq sections
593 (concat sections "-" 593 (concat sections "-"
594 (reftex-toc-extract-section-number 594 (reftex-toc-extract-section-number
595 (nth (1- nsec) entries))))) 595 (nth (1- nsec) entries)))))
@@ -614,7 +614,7 @@ point."
614 (save-window-excursion 614 (save-window-excursion
615 (reftex-toc-Rescan)) 615 (reftex-toc-Rescan))
616 (reftex-toc-restore-region start-line mark-line) 616 (reftex-toc-restore-region start-line mark-line)
617 (message "%d section%s %smoted" 617 (message "%d section%s %smoted"
618 nsec (if (= 1 nsec) "" "s") pro-or-de) 618 nsec (if (= 1 nsec) "" "s") pro-or-de)
619 nil)) 619 nil))
620 (if msg (progn (ding) (message msg))))) 620 (if msg (progn (ding) (message msg)))))
@@ -667,7 +667,7 @@ promotion/demotion later."
667 (beginning-of-line 1) 667 (beginning-of-line 1)
668 (if (looking-at reftex-section-regexp) 668 (if (looking-at reftex-section-regexp)
669 (setq name (reftex-match-string 2)) 669 (setq name (reftex-match-string 2))
670 (error "Something is wrong! Contact maintainer!"))) 670 (error "Something is wrong! Contact maintainer!")))
671 ;; Section has changed, request scan and loading 671 ;; Section has changed, request scan and loading
672 ;; We use a variable to delay until after the safe-exc. 672 ;; We use a variable to delay until after the safe-exc.
673 ;; because otherwise we loose the region. 673 ;; because otherwise we loose the region.
@@ -776,7 +776,7 @@ label prefix determines the wording of a reference."
776 (error "This is not a label entry.")) 776 (error "This is not a label entry."))
777 (setq newlabel (read-string (format "Rename label \"%s\" to:" label))) 777 (setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
778 (if (assoc newlabel (symbol-value reftex-docstruct-symbol)) 778 (if (assoc newlabel (symbol-value reftex-docstruct-symbol))
779 (if (not (y-or-n-p 779 (if (not (y-or-n-p
780 (format "Label '%s' exists. Use anyway? " label))) 780 (format "Label '%s' exists. Use anyway? " label)))
781 (error "Abort"))) 781 (error "Abort")))
782 (save-excursion 782 (save-excursion
@@ -786,7 +786,7 @@ label prefix determines the wording of a reference."
786 (reftex-query-replace-document 786 (reftex-query-replace-document
787 (concat "{" (regexp-quote label) "}") 787 (concat "{" (regexp-quote label) "}")
788 (format "{%s}" newlabel)) 788 (format "{%s}" newlabel))
789 (error t)))) 789 (error t))))
790 (reftex-toc-rescan))) 790 (reftex-toc-rescan)))
791 791
792 792
@@ -805,9 +805,9 @@ label prefix determines the wording of a reference."
805 show-window show-buffer match) 805 show-window show-buffer match)
806 806
807 (unless toc (error "Don't know which toc line to visit")) 807 (unless toc (error "Don't know which toc line to visit"))
808 808
809 (cond 809 (cond
810 810
811 ((eq (car toc) 'toc) 811 ((eq (car toc) 'toc)
812 ;; a toc entry 812 ;; a toc entry
813 (setq match (reftex-toc-find-section toc no-revisit))) 813 (setq match (reftex-toc-find-section toc no-revisit)))
@@ -823,7 +823,7 @@ label prefix determines the wording of a reference."
823 (file (nth 1 toc))) 823 (file (nth 1 toc)))
824 (if (or (not no-revisit) (reftex-get-buffer-visiting file)) 824 (if (or (not no-revisit) (reftex-get-buffer-visiting file))
825 (progn 825 (progn
826 (switch-to-buffer-other-window 826 (switch-to-buffer-other-window
827 (reftex-get-file-buffer-force file nil)) 827 (reftex-get-file-buffer-force file nil))
828 (goto-char (if (eq where 'bof) (point-min) (point-max)))) 828 (goto-char (if (eq where 'bof) (point-min) (point-max))))
829 (message reftex-no-follow-message) nil)))) 829 (message reftex-no-follow-message) nil))))
@@ -876,8 +876,8 @@ label prefix determines the wording of a reference."
876 (looking-at (reftex-make-desperate-section-regexp literal)) 876 (looking-at (reftex-make-desperate-section-regexp literal))
877 (looking-at (concat "\\\\" 877 (looking-at (concat "\\\\"
878 (regexp-quote 878 (regexp-quote
879 (car 879 (car
880 (rassq level 880 (rassq level
881 reftex-section-levels-all))) 881 reftex-section-levels-all)))
882 "[[{]?")))) 882 "[[{]?"))))
883 ((or (not no-revisit) 883 ((or (not no-revisit)
@@ -1047,7 +1047,7 @@ always show the current section in connection with the option
1047 (define-key reftex-toc-map (vector (list key)) 'digit-argument)) 1047 (define-key reftex-toc-map (vector (list key)) 'digit-argument))
1048(define-key reftex-toc-map "-" 'negative-argument) 1048(define-key reftex-toc-map "-" 'negative-argument)
1049 1049
1050(easy-menu-define 1050(easy-menu-define
1051 reftex-toc-menu reftex-toc-map 1051 reftex-toc-menu reftex-toc-map
1052 "Menu for Table of Contents buffer" 1052 "Menu for Table of Contents buffer"
1053 '("TOC" 1053 '("TOC"
@@ -1080,7 +1080,7 @@ always show the current section in connection with the option
1080 ["Context" reftex-toc-toggle-context :style toggle 1080 ["Context" reftex-toc-toggle-context :style toggle
1081 :selected reftex-toc-include-context] 1081 :selected reftex-toc-include-context]
1082 "--" 1082 "--"
1083 ["Follow Mode" reftex-toc-toggle-follow :style toggle 1083 ["Follow Mode" reftex-toc-toggle-follow :style toggle
1084 :selected reftex-toc-follow-mode] 1084 :selected reftex-toc-follow-mode]
1085 ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle 1085 ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
1086 :selected reftex-toc-auto-recenter-timer] 1086 :selected reftex-toc-auto-recenter-timer]