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: Carsten Dominik
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-toc.el
Date: Fri, 16 Sep 2005 06:01:41 -0400

Index: emacs/lisp/textmodes/reftex-toc.el
diff -c emacs/lisp/textmodes/reftex-toc.el:1.28 
emacs/lisp/textmodes/reftex-toc.el:1.29
*** emacs/lisp/textmodes/reftex-toc.el:1.28     Wed Aug 31 10:34:40 2005
--- emacs/lisp/textmodes/reftex-toc.el  Fri Sep 16 10:01:33 2005
***************
*** 1,10 ****
  ;;; reftex-toc.el --- RefTeX's table of contents mode
! 
! ;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
! ;;   2005 Free Software Foundation, Inc.
  
  ;; Author: Carsten Dominik <address@hidden>
! ;; Version: 4.28
  
  ;; This file is part of GNU Emacs.
  
--- 1,9 ----
  ;;; reftex-toc.el --- RefTeX's table of contents mode
! ;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
! ;;  Free Software Foundation, Inc.
  
  ;; Author: Carsten Dominik <address@hidden>
! ;; Version: VERSIONTAG
  
  ;; This file is part of GNU Emacs.
  
***************
*** 20,27 ****
  
  ;; You should have received a copy of the GNU General Public License
  ;; along with GNU Emacs; see the file COPYING.  If not, write to the
! ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
! ;; Boston, MA 02110-1301, USA.
  
  ;;; Commentary:
  
--- 19,26 ----
  
  ;; You should have received a copy of the GNU General Public License
  ;; along with GNU Emacs; see the file COPYING.  If not, write to the
! ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
! ;; Boston, MA 02111-1307, USA.
  
  ;;; Commentary:
  
***************
*** 36,43 ****
    "Keymap used for *toc* buffer.")
  
  (defvar reftex-toc-menu)
! (defvar zmacs-regions)
! 
  (defvar reftex-toc-include-labels-indicator nil)
  (defvar reftex-toc-include-index-indicator nil)
  (defvar reftex-toc-max-level-indicator nil)
--- 35,43 ----
    "Keymap used for *toc* buffer.")
  
  (defvar reftex-toc-menu)
! (eval-when-compile (defvar zmacs-regions))
! (defvar reftex-last-window-height nil)
! (defvar reftex-last-window-width nil)
  (defvar reftex-toc-include-labels-indicator nil)
  (defvar reftex-toc-include-index-indicator nil)
  (defvar reftex-toc-max-level-indicator nil)
***************
*** 79,91 ****
    (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t)
    (add-hook 'pre-command-hook  'reftex-toc-pre-command-hook nil t)
    (easy-menu-add reftex-toc-menu reftex-toc-map)
!   (run-mode-hooks 'reftex-toc-mode-hook))
  
  (defvar reftex-last-toc-file nil
    "Stores the file name from which `reftex-toc' was called.  For redo 
command.")
  
- (defvar reftex-last-window-height nil)
- (defvar reftex-last-window-width nil)
  
  (defvar reftex-toc-return-marker (make-marker)
    "Marker which makes it possible to return from toc to old position.")
--- 79,89 ----
    (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t)
    (add-hook 'pre-command-hook  'reftex-toc-pre-command-hook nil t)
    (easy-menu-add reftex-toc-menu reftex-toc-map)
!   (run-hooks 'reftex-toc-mode-hook))
  
  (defvar reftex-last-toc-file nil
    "Stores the file name from which `reftex-toc' was called.  For redo 
command.")
  
  
  (defvar reftex-toc-return-marker (make-marker)
    "Marker which makes it possible to return from toc to old position.")
***************
*** 152,158 ****
                           (frame-parameter (selected-frame) 'unsplittable)))
           offset toc-window)
  
!     (if (setq toc-window (get-buffer-window
                            "*toc*"
                            (if reuse 'visible)))
          (select-window toc-window)
--- 150,156 ----
                           (frame-parameter (selected-frame) 'unsplittable)))
           offset toc-window)
  
!     (if (setq toc-window (get-buffer-window 
                            "*toc*"
                            (if reuse 'visible)))
          (select-window toc-window)
***************
*** 168,174 ****
              (split-window-horizontally
               (floor (* (window-width)
                         reftex-toc-split-windows-fraction)))
!           (split-window-vertically
             (floor (* (window-height)
                       reftex-toc-split-windows-fraction)))))
  
--- 166,172 ----
              (split-window-horizontally
               (floor (* (window-width)
                         reftex-toc-split-windows-fraction)))
!           (split-window-vertically 
             (floor (* (window-height)
                       reftex-toc-split-windows-fraction)))))
  
***************
*** 213,223 ****
               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))
--- 211,221 ----
               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))
***************
*** 229,235 ****
                                     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)
--- 227,233 ----
                                     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)
***************
*** 254,260 ****
           (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)
--- 252,258 ----
           (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)
***************
*** 301,310 ****
                 (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))
--- 299,308 ----
                 (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))
***************
*** 330,336 ****
    (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."
--- 328,334 ----
    (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."
***************
*** 367,373 ****
  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))
--- 365,371 ----
  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))
***************
*** 471,477 ****
  (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))
--- 469,475 ----
  (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))
***************
*** 505,511 ****
  (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)))
--- 503,509 ----
  (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)))
***************
*** 547,552 ****
--- 545,557 ----
  
  ;; Promotion/Demotion stuff
  
+ (defvar delta)
+ (defvar mpos)
+ (defvar pro-or-de)
+ (defvar start-pos)
+ (defvar start-line)
+ (defvar mark-line)
+ 
  (defun reftex-toc-demote (&optional arg)
    "Demote section at point.  If region is active, apply to all in region."
    (interactive "p")
***************
*** 592,598 ****
              (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)))))
--- 597,603 ----
              (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)))))
***************
*** 617,633 ****
              (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)))))
  
- (defvar delta)
- (defvar mpos)
- (defvar pro-or-de)
- (defvar start-pos)
- (defvar start-line)
- (defvar mark-line)
  
  (defun reftex-toc-restore-region (point-line &optional mark-line)
    (if mark-line
--- 622,632 ----
              (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)))))
  
  
  (defun reftex-toc-restore-region (point-line &optional mark-line)
    (if mark-line
***************
*** 642,647 ****
--- 641,650 ----
            (setq mark-active t
                  deactivate-mark nil)))))
  
+ (defvar name1)
+ (defvar dummy)
+ (defvar dummy2)
+ 
  (defun reftex-toc-promote-prepare (x)
    "Look at a toc entry and see if we could pro/demote it.
  Expects the level change DELTA to be dynamically scoped into this function.
***************
*** 670,676 ****
                          (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.
--- 673,679 ----
                          (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.
***************
*** 779,785 ****
          (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
--- 782,788 ----
          (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
***************
*** 789,795 ****
              (reftex-query-replace-document
               (concat "{" (regexp-quote label) "}")
               (format "{%s}" newlabel))
!           (error t))))
      (reftex-toc-rescan)))
  
  
--- 792,798 ----
              (reftex-query-replace-document
               (concat "{" (regexp-quote label) "}")
               (format "{%s}" newlabel))
!           (error t))))        
      (reftex-toc-rescan)))
  
  
***************
*** 808,816 ****
           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)))
--- 811,819 ----
           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)))
***************
*** 826,832 ****
                    (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))))
--- 829,835 ----
                    (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))))
***************
*** 879,886 ****
                  (looking-at (reftex-make-desperate-section-regexp literal))
                  (looking-at (concat "\\\\"
                                      (regexp-quote
!                                      (car
!                                       (rassq level
                                               reftex-section-levels-all)))
                                      "[[{]?"))))
             ((or (not no-revisit)
--- 882,889 ----
                  (looking-at (reftex-make-desperate-section-regexp literal))
                  (looking-at (concat "\\\\"
                                      (regexp-quote
!                                      (car 
!                                       (rassq level 
                                               reftex-section-levels-all)))
                                      "[[{]?"))))
             ((or (not no-revisit)
***************
*** 1050,1056 ****
        (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"
--- 1053,1059 ----
        (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"
***************
*** 1083,1089 ****
      ["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]
--- 1086,1092 ----
      ["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]