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-sel.el


From: Carsten Dominik
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-sel.el
Date: Tue, 27 Aug 2002 05:54:41 -0400

Index: emacs/lisp/textmodes/reftex-sel.el
diff -c emacs/lisp/textmodes/reftex-sel.el:1.13 
emacs/lisp/textmodes/reftex-sel.el:1.14
*** emacs/lisp/textmodes/reftex-sel.el:1.13     Thu Jul 25 03:03:41 2002
--- emacs/lisp/textmodes/reftex-sel.el  Tue Aug 27 05:54:41 2002
***************
*** 89,105 ****
    ;; We do not set a local map - reftex-select-item does this.
    (run-hooks 'reftex-select-bib-mode-hook))
  
  (defun reftex-get-offset (buf here-am-I &optional typekey toc index file)
    ;; Find the correct offset data, like insert-docstruct would, but faster.
    ;; Buffer BUF knows the correct docstruct to use.
!   ;; Basically this finds the first docstruct entry after HERE-I-AM which
    ;; is of allowed type.  The optional arguments specify what is allowed.
    (catch 'exit
      (save-excursion
        (set-buffer buf)
        (reftex-access-scan-info)
!       (let* ((rest (memq here-am-I (symbol-value reftex-docstruct-symbol)))
!            entry)
        (while (setq entry (pop rest))
          (if (or (and typekey
                       (stringp (car entry))
--- 89,128 ----
    ;; We do not set a local map - reftex-select-item does this.
    (run-hooks 'reftex-select-bib-mode-hook))
  
+ ;;; (defun reftex-get-offset (buf here-am-I &optional typekey toc index file)
+ ;;;   ;; Find the correct offset data, like insert-docstruct would, but 
faster.
+ ;;;   ;; Buffer BUF knows the correct docstruct to use.
+ ;;;   ;; Basically this finds the first docstruct entry after HERE-I-AM which
+ ;;;   ;; is of allowed type.  The optional arguments specify what is allowed.
+ ;;;   (catch 'exit
+ ;;;     (save-excursion
+ ;;;       (set-buffer buf)
+ ;;;       (reftex-access-scan-info)
+ ;;;       (let* ((rest (memq here-am-I (symbol-value 
reftex-docstruct-symbol)))
+ ;;;        entry)
+ ;;;   (while (setq entry (pop rest))
+ ;;;     (if (or (and typekey
+ ;;;                  (stringp (car entry))
+ ;;;                  (or (equal typekey " ")
+ ;;;                      (equal typekey (nth 1 entry))))
+ ;;;             (and toc (eq (car entry) 'toc))
+ ;;;             (and index (eq (car entry) 'index))
+ ;;;             (and file
+ ;;;                  (memq (car entry) '(bof eof file-error))))
+ ;;;         (throw 'exit entry)))
+ ;;;   nil))))
+ 
  (defun reftex-get-offset (buf here-am-I &optional typekey toc index file)
    ;; Find the correct offset data, like insert-docstruct would, but faster.
    ;; Buffer BUF knows the correct docstruct to use.
!   ;; Basically this finds the first docstruct entry before HERE-I-AM which
    ;; is of allowed type.  The optional arguments specify what is allowed.
    (catch 'exit
      (save-excursion
        (set-buffer buf)
        (reftex-access-scan-info)
!       (let* ((rest (symbol-value reftex-docstruct-symbol))
!            lastentry entry)
        (while (setq entry (pop rest))
          (if (or (and typekey
                       (stringp (car entry))
***************
*** 109,115 ****
                  (and index (eq (car entry) 'index))
                  (and file
                       (memq (car entry) '(bof eof file-error))))
!             (throw 'exit entry)))
        nil))))
  
  (defun reftex-insert-docstruct
--- 132,140 ----
                  (and index (eq (car entry) 'index))
                  (and file
                       (memq (car entry) '(bof eof file-error))))
!             (setq lastentry entry))
!         (if (eq entry here-am-I)
!             (throw 'exit (or lastentry entry))))
        nil))))
  
  (defun reftex-insert-docstruct
***************
*** 149,155 ****
                                           'font-lock-constant-face
                                           'font-lock-reference-face))
           all cell text label typekey note comment master-dir-re
!          offset from to index-tag docstruct-symbol)
  
      ;; Pop to buffer buf to get the correct buffer-local variables
      (save-excursion
--- 174,180 ----
                                           'font-lock-constant-face
                                           'font-lock-reference-face))
           all cell text label typekey note comment master-dir-re
!        prev-inserted offset from to index-tag docstruct-symbol)
  
      ;; Pop to buffer buf to get the correct buffer-local variables
      (save-excursion
***************
*** 176,183 ****
        (incf index)
        (setq from (point))
  
-       (if (eq cell here-I-am) (setq offset 'attention))
- 
        (cond
  
         ((memq (car cell) '(bib thebib label-numbers appendix
--- 201,206 ----
***************
*** 187,193 ****
         ((memq (car cell) '(bof eof file-error))
          ;; Beginning or end of a file
          (when files
!         (if (eq offset 'attention) (setq offset cell))
            (insert
             " File " (if (string-match master-dir-re (nth 1 cell))
                     (substring (nth 1 cell) (match-end 0))
--- 210,217 ----
         ((memq (car cell) '(bof eof file-error))
          ;; Beginning or end of a file
          (when files
!         (setq prev-inserted cell)
! ;       (if (eq offset 'attention) (setq offset cell))
            (insert
             " File " (if (string-match master-dir-re (nth 1 cell))
                     (substring (nth 1 cell) (match-end 0))
***************
*** 209,215 ****
          ;; a table of contents entry
          (when (and toc
                   (<= (nth 5 cell) reftex-toc-max-level))
!         (if (eq offset 'attention) (setq offset cell))
            (setq reftex-active-toc cell)
            (insert (concat toc-indent (nth 2 cell) "\n"))
          (setq to (point))
--- 233,240 ----
          ;; a table of contents entry
          (when (and toc
                   (<= (nth 5 cell) reftex-toc-max-level))
!         (setq prev-inserted cell)
! ;       (if (eq offset 'attention) (setq offset cell))
            (setq reftex-active-toc cell)
            (insert (concat toc-indent (nth 2 cell) "\n"))
          (setq to (point))
***************
*** 244,250 ****
  
            ;; Yes we want this one
            (incf cnt)
!         (if (eq offset 'attention) (setq offset cell))
  
          (setq label (concat xr-prefix label))
            (when comment (setq label (concat "% " label)))
--- 269,276 ----
  
            ;; Yes we want this one
            (incf cnt)
!         (setq prev-inserted cell)
! ;       (if (eq offset 'attention) (setq offset cell))
  
          (setq label (concat xr-prefix label))
            (when comment (setq label (concat "% " label)))
***************
*** 278,284 ****
        (when (and index-entries
                   (or (eq t index-entries)
                       (string= index-entries (nth 1 cell))))
!         (if (eq offset 'attention) (setq offset cell))
          (setq index-tag (format "<%s>" (nth 1 cell)))
          (and font
               (put-text-property 0 (length index-tag)
--- 304,311 ----
        (when (and index-entries
                   (or (eq t index-entries)
                       (string= index-entries (nth 1 cell))))
!         (setq prev-inserted cell)
! ;       (if (eq offset 'attention) (setq offset cell))
          (setq index-tag (format "<%s>" (nth 1 cell)))
          (and font
               (put-text-property 0 (length index-tag)
***************
*** 301,307 ****
          (when mouse-face
            (put-text-property from (1- to)
                               'mouse-face mouse-face))   
!           (goto-char to)))))
  
      (when (reftex-refontify)
        ;; we need to fontify the buffer
--- 328,340 ----
          (when mouse-face
            (put-text-property from (1- to)
                               'mouse-face mouse-face))   
!           (goto-char to))))
! 
!       (if (eq cell here-I-am) 
!         (setq offset 'attention))
!       (if (and prev-inserted (eq offset 'attention))
!         (setq offset prev-inserted))
!       )
  
      (when (reftex-refontify)
        ;; we need to fontify the buffer




reply via email to

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