emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-toc.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-toc.el
Date: Tue, 14 Jun 2005 11:36:09 -0400

Index: emacs/lisp/textmodes/reftex-toc.el
diff -c emacs/lisp/textmodes/reftex-toc.el:1.24 
emacs/lisp/textmodes/reftex-toc.el:1.25
*** emacs/lisp/textmodes/reftex-toc.el:1.24     Thu May 26 17:13:30 2005
--- emacs/lisp/textmodes/reftex-toc.el  Tue Jun 14 15:36:08 2005
***************
*** 149,155 ****
                           (frame-parameter (selected-frame) 'unsplittable)))
           offset toc-window)
  
!     (if (setq toc-window (get-buffer-window 
                            "*toc*"
                            (if reuse 'visible)))
          (select-window toc-window)
--- 149,155 ----
                           (frame-parameter (selected-frame) 'unsplittable)))
           offset toc-window)
  
!     (if (setq toc-window (get-buffer-window
                            "*toc*"
                            (if reuse 'visible)))
          (select-window toc-window)
***************
*** 165,171 ****
              (split-window-horizontally
               (floor (* (window-width)
                         reftex-toc-split-windows-fraction)))
!           (split-window-vertically 
             (floor (* (window-height)
                       reftex-toc-split-windows-fraction)))))
  
--- 165,171 ----
              (split-window-horizontally
               (floor (* (window-width)
                         reftex-toc-split-windows-fraction)))
!           (split-window-vertically
             (floor (* (window-height)
                       reftex-toc-split-windows-fraction)))))
  
***************
*** 210,220 ****
               reftex-toc-include-context
               nil ; counter
               nil ; commented
!              here-I-am 
               ""     ; xr-prefix
               t      ; a toc buffer
               ))
!        
        (run-hooks 'reftex-display-copied-context-hook)
        (message "Building *toc* buffer...done.")
        (setq buffer-read-only t))
--- 210,220 ----
               reftex-toc-include-context
               nil ; counter
               nil ; commented
!              here-I-am
               ""     ; xr-prefix
               t      ; a toc buffer
               ))
! 
        (run-hooks 'reftex-display-copied-context-hook)
        (message "Building *toc* buffer...done.")
        (setq buffer-read-only t))
***************
*** 226,232 ****
                                     t
                                     reftex-toc-include-index-entries
                                     reftex-toc-include-file-boundaries)
!                 (reftex-last-assoc-before-elt 
                   'toc here-I-am
                   (symbol-value reftex-docstruct-symbol))))
        (put 'reftex-toc :reftex-line 3)
--- 226,232 ----
                                     t
                                     reftex-toc-include-index-entries
                                     reftex-toc-include-file-boundaries)
!                 (reftex-last-assoc-before-elt
                   'toc here-I-am
                   (symbol-value reftex-docstruct-symbol))))
        (put 'reftex-toc :reftex-line 3)
***************
*** 251,257 ****
           (not (get-text-property (point) 'intangible))
           (memq reftex-highlight-selection '(cursor both))
           (reftex-highlight 2
!                            (or (previous-single-property-change 
                                  (min (point-max) (1+ (point))) :data)
                                 (point-min))
                             (or (next-single-property-change (point) :data)
--- 251,257 ----
           (not (get-text-property (point) 'intangible))
           (memq reftex-highlight-selection '(cursor both))
           (reftex-highlight 2
!                            (or (previous-single-property-change
                                  (min (point-max) (1+ (point))) :data)
                                 (point-min))
                             (or (next-single-property-change (point) :data)
***************
*** 298,313 ****
                 (window-height))))))
  
  (defun reftex-toc-dframe-p (&optional frame error)
!   ;; Check if FRAME is the dedicated TOC frame.  
    ;; If yes, and ERROR is non-nil, throw an error.
    (setq frame (or frame (selected-frame)))
!   (let ((res (equal 
                (if (fboundp 'frame-property)
                    (frame-property frame 'name)
                  (frame-parameter  frame 'name))
                "RefTeX TOC Frame")))
      (if (and res error)
!         (error "This frame is view-only.  Use `C-c =' to create toc window 
for commands."))
      res))
  
  (defun reftex-toc-show-help ()
--- 298,313 ----
                 (window-height))))))
  
  (defun reftex-toc-dframe-p (&optional frame error)
!   ;; Check if FRAME is the dedicated TOC frame.
    ;; If yes, and ERROR is non-nil, throw an error.
    (setq frame (or frame (selected-frame)))
!   (let ((res (equal
                (if (fboundp 'frame-property)
                    (frame-property frame 'name)
                  (frame-parameter  frame 'name))
                "RefTeX TOC Frame")))
      (if (and res error)
!         (error "This frame is view-only.  Use `C-c =' to create toc window 
for commands"))
      res))
  
  (defun reftex-toc-show-help ()
***************
*** 327,333 ****
    (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t))
    (setq reftex-callback-fwd t)
    (or (eobp) (forward-char 1))
!   (goto-char (or (next-single-property-change (point) :data) 
                   (point))))
  (defun reftex-toc-previous (&optional arg)
    "Move to previous selectable item."
--- 327,333 ----
    (if (boundp 'zmacs-region-stays) (setq zmacs-region-stays t))
    (setq reftex-callback-fwd t)
    (or (eobp) (forward-char 1))
!   (goto-char (or (next-single-property-change (point) :data)
                   (point))))
  (defun reftex-toc-previous (&optional arg)
    "Move to previous selectable item."
***************
*** 364,370 ****
  With prefix ARG, prompt for a label type and include only labels of
  that specific type."
    (interactive "P")
!   (setq reftex-toc-include-labels 
          (if arg (reftex-query-label-type)
            (not reftex-toc-include-labels)))
    (reftex-toc-revert))
--- 364,370 ----
  With prefix ARG, prompt for a label type and include only labels of
  that specific type."
    (interactive "P")
!   (setq reftex-toc-include-labels
          (if arg (reftex-query-label-type)
            (not reftex-toc-include-labels)))
    (reftex-toc-revert))
***************
*** 468,474 ****
  (defun reftex-toc-rescan (&rest ignore)
    "Regenerate the *toc* buffer by reparsing file of section at point."
    (interactive)
!   (if (and reftex-enable-partial-scans 
             (null current-prefix-arg))
        (let* ((data (get-text-property (point) :data))
               (what (car data))
--- 468,474 ----
  (defun reftex-toc-rescan (&rest ignore)
    "Regenerate the *toc* buffer by reparsing file of section at point."
    (interactive)
!   (if (and reftex-enable-partial-scans
             (null current-prefix-arg))
        (let* ((data (get-text-property (point) :data))
               (what (car data))
***************
*** 502,508 ****
  (defun reftex-toc-revert (&rest ignore)
    "Regenerate the *toc* from the internal lists."
    (interactive)
!   (let ((unsplittable 
           (if (fboundp 'frame-property)
               (frame-property (selected-frame) 'unsplittable)
             (frame-parameter (selected-frame) 'unsplittable)))
--- 502,508 ----
  (defun reftex-toc-revert (&rest ignore)
    "Regenerate the *toc* from the internal lists."
    (interactive)
!   (let ((unsplittable
           (if (fboundp 'frame-property)
               (frame-property (selected-frame) 'unsplittable)
             (frame-parameter (selected-frame) 'unsplittable)))
***************
*** 589,595 ****
              (goto-char start-pos)
              (setq sections (reftex-toc-extract-section-number (car entries)))
              (if (> (setq nsec (length entries)) 1)
!                 (setq sections 
                        (concat sections "-"
                                (reftex-toc-extract-section-number
                                 (nth (1- nsec) entries)))))
--- 589,595 ----
              (goto-char start-pos)
              (setq sections (reftex-toc-extract-section-number (car entries)))
              (if (> (setq nsec (length entries)) 1)
!                 (setq sections
                        (concat sections "-"
                                (reftex-toc-extract-section-number
                                 (nth (1- nsec) entries)))))
***************
*** 614,620 ****
              (save-window-excursion
                (reftex-toc-Rescan))
              (reftex-toc-restore-region start-line mark-line)
!             (message "%d section%s %smoted" 
                       nsec (if (= 1 nsec) "" "s") pro-or-de)
              nil))
      (if msg (progn (ding) (message msg)))))
--- 614,620 ----
              (save-window-excursion
                (reftex-toc-Rescan))
              (reftex-toc-restore-region start-line mark-line)
!             (message "%d section%s %smoted"
                       nsec (if (= 1 nsec) "" "s") pro-or-de)
              nil))
      (if msg (progn (ding) (message msg)))))
***************
*** 667,673 ****
                          (beginning-of-line 1)
                          (if (looking-at reftex-section-regexp)
                              (setq name (reftex-match-string 2))
!                           (error "Something is wrong! Contact maintainer!")))
                      ;; Section has changed, request scan and loading
                      ;; We use a variable to delay until after the safe-exc.
                      ;; because otherwise we loose the region.
--- 667,673 ----
                          (beginning-of-line 1)
                          (if (looking-at reftex-section-regexp)
                              (setq name (reftex-match-string 2))
!                           (error "Something is wrong!  Contact maintainer!")))
                      ;; Section has changed, request scan and loading
                      ;; We use a variable to delay until after the safe-exc.
                      ;; because otherwise we loose the region.
***************
*** 776,782 ****
          (error "This is not a label entry."))
      (setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
      (if (assoc newlabel (symbol-value reftex-docstruct-symbol))
!         (if (not (y-or-n-p 
                    (format "Label '%s' exists. Use anyway? " label)))
              (error "Abort")))
      (save-excursion
--- 776,782 ----
          (error "This is not a label entry."))
      (setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
      (if (assoc newlabel (symbol-value reftex-docstruct-symbol))
!         (if (not (y-or-n-p
                    (format "Label '%s' exists. Use anyway? " label)))
              (error "Abort")))
      (save-excursion
***************
*** 786,792 ****
              (reftex-query-replace-document
               (concat "{" (regexp-quote label) "}")
               (format "{%s}" newlabel))
!           (error t))))        
      (reftex-toc-rescan)))
  
  
--- 786,792 ----
              (reftex-query-replace-document
               (concat "{" (regexp-quote label) "}")
               (format "{%s}" newlabel))
!           (error t))))
      (reftex-toc-rescan)))
  
  
***************
*** 805,813 ****
           show-window show-buffer match)
  
      (unless toc (error "Don't know which toc line to visit"))
!     
      (cond
!   
       ((eq (car toc) 'toc)
        ;; a toc entry
        (setq match (reftex-toc-find-section toc no-revisit)))
--- 805,813 ----
           show-window show-buffer match)
  
      (unless toc (error "Don't know which toc line to visit"))
! 
      (cond
! 
       ((eq (car toc) 'toc)
        ;; a toc entry
        (setq match (reftex-toc-find-section toc no-revisit)))
***************
*** 823,829 ****
                    (file (nth 1 toc)))
                (if (or (not no-revisit) (reftex-get-buffer-visiting file))
                    (progn
!                     (switch-to-buffer-other-window 
                       (reftex-get-file-buffer-force file nil))
                      (goto-char (if (eq where 'bof) (point-min) (point-max))))
                  (message reftex-no-follow-message) nil))))
--- 823,829 ----
                    (file (nth 1 toc)))
                (if (or (not no-revisit) (reftex-get-buffer-visiting file))
                    (progn
!                     (switch-to-buffer-other-window
                       (reftex-get-file-buffer-force file nil))
                      (goto-char (if (eq where 'bof) (point-min) (point-max))))
                  (message reftex-no-follow-message) nil))))
***************
*** 876,883 ****
                  (looking-at (reftex-make-desperate-section-regexp literal))
                  (looking-at (concat "\\\\"
                                      (regexp-quote
!                                      (car 
!                                       (rassq level 
                                               reftex-section-levels-all)))
                                      "[[{]?"))))
             ((or (not no-revisit)
--- 876,883 ----
                  (looking-at (reftex-make-desperate-section-regexp literal))
                  (looking-at (concat "\\\\"
                                      (regexp-quote
!                                      (car
!                                       (rassq level
                                               reftex-section-levels-all)))
                                      "[[{]?"))))
             ((or (not no-revisit)
***************
*** 1047,1053 ****
        (define-key reftex-toc-map (vector (list key)) 'digit-argument))
  (define-key reftex-toc-map "-" 'negative-argument)
  
! (easy-menu-define 
   reftex-toc-menu reftex-toc-map
   "Menu for Table of Contents buffer"
   '("TOC"
--- 1047,1053 ----
        (define-key reftex-toc-map (vector (list key)) 'digit-argument))
  (define-key reftex-toc-map "-" 'negative-argument)
  
! (easy-menu-define
   reftex-toc-menu reftex-toc-map
   "Menu for Table of Contents buffer"
   '("TOC"
***************
*** 1080,1086 ****
      ["Context" reftex-toc-toggle-context :style toggle
       :selected reftex-toc-include-context]
      "--"
!     ["Follow Mode" reftex-toc-toggle-follow :style toggle 
       :selected reftex-toc-follow-mode]
      ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
       :selected reftex-toc-auto-recenter-timer]
--- 1080,1086 ----
      ["Context" reftex-toc-toggle-context :style toggle
       :selected reftex-toc-include-context]
      "--"
!     ["Follow Mode" reftex-toc-toggle-follow :style toggle
       :selected reftex-toc-follow-mode]
      ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
       :selected reftex-toc-auto-recenter-timer]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]