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-auc.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-auc.el [lexbind]
Date: Tue, 14 Oct 2003 19:30:35 -0400

Index: emacs/lisp/textmodes/reftex-auc.el
diff -c emacs/lisp/textmodes/reftex-auc.el:1.10.8.1 
emacs/lisp/textmodes/reftex-auc.el:1.10.8.2
*** emacs/lisp/textmodes/reftex-auc.el:1.10.8.1 Fri Apr  4 01:20:39 2003
--- emacs/lisp/textmodes/reftex-auc.el  Tue Oct 14 19:30:21 2003
***************
*** 1,8 ****
  ;;; reftex-auc.el --- RefTeX's interface to AUC TeX
! ;; Copyright (c) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
  
  ;; Author: Carsten Dominik <address@hidden>
! ;; Version: 4.18
  
  ;; This file is part of GNU Emacs.
  
--- 1,8 ----
  ;;; reftex-auc.el --- RefTeX's interface to AUC TeX
! ;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
  
  ;; Author: Carsten Dominik <address@hidden>
! ;; Version: 4.21
  
  ;; This file is part of GNU Emacs.
  
***************
*** 34,40 ****
    ;; Tell if a certain flag is set in reftex-plug-into-AUCTeX
    (or (eq t reftex-plug-into-AUCTeX)
        (and (listp reftex-plug-into-AUCTeX)
!          (nth which reftex-plug-into-AUCTeX))))
  
  (defun reftex-arg-label (optional &optional prompt definition)
    "Use `reftex-label', `reftex-reference' or AUCTeX's code to insert label 
arg.
--- 34,40 ----
    ;; Tell if a certain flag is set in reftex-plug-into-AUCTeX
    (or (eq t reftex-plug-into-AUCTeX)
        (and (listp reftex-plug-into-AUCTeX)
!            (nth which reftex-plug-into-AUCTeX))))
  
  (defun reftex-arg-label (optional &optional prompt definition)
    "Use `reftex-label', `reftex-reference' or AUCTeX's code to insert label 
arg.
***************
*** 44,60 ****
       ((and definition (reftex-plug-flag 1))
        ;; Create a new label, with a temporary brace for `reftex-what-macro'
        (unwind-protect
!         (progn (insert "{") (setq label (or (reftex-label nil t) "")))
!       (delete-backward-char 1)))
       ((and (not definition) (reftex-plug-flag 2))
        ;; Reference a label with RefTeX
        (setq label (reftex-reference nil t)))
       (t
        ;; AUCTeX's default mechanism
        (setq label (completing-read (TeX-argument-prompt optional prompt "Key")
!                                  (LaTeX-label-list)))))
      (if (and definition (not (string-equal "" label)))
!       (LaTeX-add-labels label))
      (TeX-argument-insert label optional)))
  
  (defun reftex-arg-cite (optional &optional prompt definition)
--- 44,60 ----
       ((and definition (reftex-plug-flag 1))
        ;; Create a new label, with a temporary brace for `reftex-what-macro'
        (unwind-protect
!           (progn (insert "{") (setq label (or (reftex-label nil t) "")))
!         (delete-backward-char 1)))
       ((and (not definition) (reftex-plug-flag 2))
        ;; Reference a label with RefTeX
        (setq label (reftex-reference nil t)))
       (t
        ;; AUCTeX's default mechanism
        (setq label (completing-read (TeX-argument-prompt optional prompt "Key")
!                                    (LaTeX-label-list)))))
      (if (and definition (not (string-equal "" label)))
!         (LaTeX-add-labels label))
      (TeX-argument-insert label optional)))
  
  (defun reftex-arg-cite (optional &optional prompt definition)
***************
*** 66,93 ****
        (setq items (list (or (reftex-citation t) ""))))
       (t
        (setq prompt (concat (if optional "(Optional) " "")
!                          (if prompt prompt "Add key")
!                          ": (default none) "))
        (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list)))))
      (apply 'LaTeX-add-bibitems items)
      (TeX-argument-insert (mapconcat 'identity items ",") optional)))
  
  
  (defun reftex-arg-index-tag (optional &optional prompt &rest args)
!   "Prompt for an index tag with completion.
  This is the name of an index, not the entry."
    (let (tag taglist)
      (setq prompt (concat (if optional "(Optional) " "")
!                        (if prompt prompt "Index tag")
!                        ": (default none) "))
      (if (and reftex-support-index (reftex-plug-flag 4))
!       ;; Use RefTeX completion
!       (progn
!         (reftex-access-scan-info nil)
!         (setq taglist
!               (cdr (assoc 'index-tags
!                           (symbol-value reftex-docstruct-symbol)))
!               tag (completing-read prompt (mapcar 'list taglist))))
        ;; Just ask like AUCTeX does.
        (setq tag (read-string prompt)))
      (TeX-argument-insert tag optional)))
--- 66,93 ----
        (setq items (list (or (reftex-citation t) ""))))
       (t
        (setq prompt (concat (if optional "(Optional) " "")
!                            (if prompt prompt "Add key")
!                            ": (default none) "))
        (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list)))))
      (apply 'LaTeX-add-bibitems items)
      (TeX-argument-insert (mapconcat 'identity items ",") optional)))
  
  
  (defun reftex-arg-index-tag (optional &optional prompt &rest args)
!   "Prompt for an index tag with completion. 
  This is the name of an index, not the entry."
    (let (tag taglist)
      (setq prompt (concat (if optional "(Optional) " "")
!                          (if prompt prompt "Index tag")
!                          ": (default none) "))
      (if (and reftex-support-index (reftex-plug-flag 4))
!         ;; Use RefTeX completion
!         (progn
!           (reftex-access-scan-info nil)
!           (setq taglist 
!                 (cdr (assoc 'index-tags 
!                             (symbol-value reftex-docstruct-symbol)))
!                 tag (completing-read prompt (mapcar 'list taglist))))
        ;; Just ask like AUCTeX does.
        (setq tag (read-string prompt)))
      (TeX-argument-insert tag optional)))
***************
*** 98,109 ****
  argument identify one of multiple indices."
    (let* (tag key)
      (if (and reftex-support-index (reftex-plug-flag 4))
!       (progn
!         (reftex-access-scan-info nil)
!         (setq tag (reftex-what-index-tag)
!               key (reftex-index-complete-key (or tag "idx"))))
        (setq key (completing-read (TeX-argument-prompt optional prompt "Key")
!                                (LaTeX-index-entry-list))))
      (unless (string-equal "" key)
        (LaTeX-add-index-entries key))
      (TeX-argument-insert key optional)))
--- 98,109 ----
  argument identify one of multiple indices."
    (let* (tag key)
      (if (and reftex-support-index (reftex-plug-flag 4))
!         (progn
!           (reftex-access-scan-info nil)
!           (setq tag (reftex-what-index-tag)
!                 key (reftex-index-complete-key (or tag "idx"))))
        (setq key (completing-read (TeX-argument-prompt optional prompt "Key")
!                                  (LaTeX-index-entry-list))))
      (unless (string-equal "" key)
        (LaTeX-add-index-entries key))
      (TeX-argument-insert key optional)))
***************
*** 111,128 ****
  (defun reftex-what-index-tag ()
    ;; Look backward to find out what index the macro at point belongs to
    (let ((macro (save-excursion
!                (and (re-search-backward "\\\\[a-zA-Z*]+" nil t)
!                     (match-string 0))))
!       tag entry)
      (when (and macro
!              (setq entry (assoc macro reftex-index-macro-alist)))
        (setq tag (nth 1 entry))
        (cond
         ((stringp tag) tag)
         ((integerp tag)
!       (save-excursion
!         (goto-char (match-end 1))
!         (or (reftex-nth-arg tag (nth 6 entry)) "idx")))
         (t "idx")))))
  
  (defvar LaTeX-label-function)
--- 111,128 ----
  (defun reftex-what-index-tag ()
    ;; Look backward to find out what index the macro at point belongs to
    (let ((macro (save-excursion
!                  (and (re-search-backward "\\\\[a-zA-Z*]+" nil t)
!                       (match-string 0))))
!         tag entry)
      (when (and macro
!                (setq entry (assoc macro reftex-index-macro-alist)))
        (setq tag (nth 1 entry))
        (cond
         ((stringp tag) tag)
         ((integerp tag)
!         (save-excursion
!           (goto-char (match-end 1))
!           (or (reftex-nth-arg tag (nth 6 entry)) "idx")))
         (t "idx")))))
  
  (defvar LaTeX-label-function)
***************
*** 130,136 ****
    ;; Replace AUCTeX functions with RefTeX functions.
    ;; Which functions are replaced is controlled by the variable
    ;; `reftex-plug-into-AUCTeX'.
! 
    (if (reftex-plug-flag 0)
        (setq LaTeX-label-function 'reftex-label)
      (setq LaTeX-label-function nil))
--- 130,136 ----
    ;; Replace AUCTeX functions with RefTeX functions.
    ;; Which functions are replaced is controlled by the variable
    ;; `reftex-plug-into-AUCTeX'.
!   
    (if (reftex-plug-flag 0)
        (setq LaTeX-label-function 'reftex-label)
      (setq LaTeX-label-function nil))
***************
*** 142,152 ****
    (and (reftex-plug-flag 3)
         (fboundp 'TeX-arg-cite)
         (fset 'TeX-arg-cite 'reftex-arg-cite))
! 
!   (and (reftex-plug-flag 4)
         (fboundp 'TeX-arg-index-tag)
         (fset 'TeX-arg-index-tag 'reftex-arg-index-tag))
!   (and (reftex-plug-flag 4)
         (fboundp 'TeX-arg-index)
         (fset 'TeX-arg-index 'reftex-arg-index)))
  
--- 142,152 ----
    (and (reftex-plug-flag 3)
         (fboundp 'TeX-arg-cite)
         (fset 'TeX-arg-cite 'reftex-arg-cite))
!   
!   (and (reftex-plug-flag 4) 
         (fboundp 'TeX-arg-index-tag)
         (fset 'TeX-arg-index-tag 'reftex-arg-index-tag))
!   (and (reftex-plug-flag 4) 
         (fboundp 'TeX-arg-index)
         (fset 'TeX-arg-index 'reftex-arg-index)))
  
***************
*** 174,190 ****
    (unless reftex-docstruct-symbol
      (reftex-tie-multifile-symbols))
    (when (and reftex-docstruct-symbol
!            (symbolp reftex-docstruct-symbol))
      (let ((list (get reftex-docstruct-symbol 'reftex-label-alist-style))
!         entry changed)
        (while entry-list
!       (setq entry (pop entry-list))
!       (unless (member entry list)
!         (setq reftex-tables-dirty t
!               changed t)
!         (push entry list)))
        (when changed
!       (put reftex-docstruct-symbol 'reftex-label-alist-style list)))))
  (defalias 'reftex-add-to-label-alist 'reftex-add-label-environments)
  
  (defun reftex-add-section-levels (entry-list)
--- 174,190 ----
    (unless reftex-docstruct-symbol
      (reftex-tie-multifile-symbols))
    (when (and reftex-docstruct-symbol
!              (symbolp reftex-docstruct-symbol))
      (let ((list (get reftex-docstruct-symbol 'reftex-label-alist-style))
!           entry changed)
        (while entry-list
!         (setq entry (pop entry-list))
!         (unless (member entry list)
!           (setq reftex-tables-dirty t
!                 changed t)
!           (push entry list)))
        (when changed
!         (put reftex-docstruct-symbol 'reftex-label-alist-style list)))))
  (defalias 'reftex-add-to-label-alist 'reftex-add-label-environments)
  
  (defun reftex-add-section-levels (entry-list)
***************
*** 195,213 ****
    (unless reftex-docstruct-symbol
      (reftex-tie-multifile-symbols))
    (when (and reftex-docstruct-symbol
!            (symbolp reftex-docstruct-symbol))
      (let ((list (get reftex-docstruct-symbol 'reftex-section-levels))
!         entry changed)
        (while entry-list
!       (setq entry (pop entry-list))
!       (unless (member entry list)
!         (setq reftex-tables-dirty t
!               changed t)
!         (push entry list)))
        (when changed
!       (put reftex-docstruct-symbol 'reftex-section-levels list)))))
  
  (defun reftex-notice-new-section ()
    (reftex-notice-new 1 'force))
  
  ;;; reftex-auc.el ends here
--- 195,214 ----
    (unless reftex-docstruct-symbol
      (reftex-tie-multifile-symbols))
    (when (and reftex-docstruct-symbol
!              (symbolp reftex-docstruct-symbol))
      (let ((list (get reftex-docstruct-symbol 'reftex-section-levels))
!           entry changed)
        (while entry-list
!         (setq entry (pop entry-list))
!         (unless (member entry list)
!           (setq reftex-tables-dirty t
!                 changed t)
!           (push entry list)))
        (when changed
!         (put reftex-docstruct-symbol 'reftex-section-levels list)))))
  
  (defun reftex-notice-new-section ()
    (reftex-notice-new 1 'force))
  
+ ;;; arch-tag: 4a798e68-3405-421c-a09b-0269aac64ab4
  ;;; reftex-auc.el ends here




reply via email to

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