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


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

Index: emacs/lisp/textmodes/reftex.el
diff -c emacs/lisp/textmodes/reftex.el:1.61 emacs/lisp/textmodes/reftex.el:1.62
*** emacs/lisp/textmodes/reftex.el:1.61 Thu May 19 08:21:07 2005
--- emacs/lisp/textmodes/reftex.el      Tue Jun 14 15:35:03 2005
***************
*** 26,32 ****
  ;;---------------------------------------------------------------------------
  ;;
  ;;; Commentary:
! ;; 
  ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite,
  ;; and \index commands in (multi-file) LaTeX documents.
  ;; - A table of contents provides easy access to any part of a document.
--- 26,32 ----
  ;;---------------------------------------------------------------------------
  ;;
  ;;; Commentary:
! ;;
  ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite,
  ;; and \index commands in (multi-file) LaTeX documents.
  ;; - A table of contents provides easy access to any part of a document.
***************
*** 71,77 ****
  ;;
  ;; Introduction
  ;; ************
! ;; 
  ;; RefTeX is a specialized package for support of labels, references,
  ;; citations, and the index in LaTeX.  RefTeX wraps itself round 4 LaTeX
  ;; macros: `\label', `\ref', `\cite', and `\index'.  Using these macros
--- 71,77 ----
  ;;
  ;; Introduction
  ;; ************
! ;;
  ;; RefTeX is a specialized package for support of labels, references,
  ;; citations, and the index in LaTeX.  RefTeX wraps itself round 4 LaTeX
  ;; macros: `\label', `\ref', `\cite', and `\index'.  Using these macros
***************
*** 80,92 ****
  ;; time-consuming tasks almost entirely.  It also provides functions to
  ;; display the structure of a document and to move around in this
  ;; structure quickly.
! ;; 
  ;;    *Note Imprint::, for information about who to contact for help, bug
  ;; reports or suggestions.
! ;; 
  ;; Environment
  ;; ===========
! ;; 
  ;; RefTeX needs to access all files which are part of a multifile
  ;; document, and the BibTeX database files requested by the
  ;; `\bibliography' command.  To find these files, RefTeX will require a
--- 80,92 ----
  ;; time-consuming tasks almost entirely.  It also provides functions to
  ;; display the structure of a document and to move around in this
  ;; structure quickly.
! ;;
  ;;    *Note Imprint::, for information about who to contact for help, bug
  ;; reports or suggestions.
! ;;
  ;; Environment
  ;; ===========
! ;;
  ;; RefTeX needs to access all files which are part of a multifile
  ;; document, and the BibTeX database files requested by the
  ;; `\bibliography' command.  To find these files, RefTeX will require a
***************
*** 95,120 ****
  ;; which are also used by RefTeX.  However, on some systems these
  ;; variables do not contain the full search path.  If RefTeX does not work
  ;; for you because it cannot find some files, read *Note Finding Files::.
! ;; 
  ;; Entering RefTeX Mode
  ;; ====================
! ;; 
  ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x
  ;; reftex-mode'.  To turn on RefTeX Mode for all LaTeX files, add the
  ;; following lines to your `.emacs' file:
! ;; 
  ;;      (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
  ;;      (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
! ;; 
  ;; RefTeX in a Nutshell
  ;; ====================
! ;; 
  ;;   1. Table of Contents
  ;;      Typing `C-c =' (`reftex-toc') will show a table of contents of the
  ;;      document.  This buffer can display sections, labels and index
  ;;      entries defined in the document.  From the buffer, you can jump
  ;;      quickly to every part of your document.  Press `?' to get help.
! ;; 
  ;;   2. Labels and References
  ;;      RefTeX helps to create unique labels and to find the correct key
  ;;      for references quickly.  It distinguishes labels for different
--- 95,120 ----
  ;; which are also used by RefTeX.  However, on some systems these
  ;; variables do not contain the full search path.  If RefTeX does not work
  ;; for you because it cannot find some files, read *Note Finding Files::.
! ;;
  ;; Entering RefTeX Mode
  ;; ====================
! ;;
  ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x
  ;; reftex-mode'.  To turn on RefTeX Mode for all LaTeX files, add the
  ;; following lines to your `.emacs' file:
! ;;
  ;;      (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
  ;;      (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
! ;;
  ;; RefTeX in a Nutshell
  ;; ====================
! ;;
  ;;   1. Table of Contents
  ;;      Typing `C-c =' (`reftex-toc') will show a table of contents of the
  ;;      document.  This buffer can display sections, labels and index
  ;;      entries defined in the document.  From the buffer, you can jump
  ;;      quickly to every part of your document.  Press `?' to get help.
! ;;
  ;;   2. Labels and References
  ;;      RefTeX helps to create unique labels and to find the correct key
  ;;      for references quickly.  It distinguishes labels for different
***************
*** 122,128 ****
  ;;      others), and can be configured to recognize any additional labeled
  ;;      environments you have defined yourself (variable
  ;;      `reftex-label-alist').
! ;; 
  ;;         * Creating Labels
  ;;           Type `C-c (' (`reftex-label') to insert a label at point.
  ;;           RefTeX will either
--- 122,128 ----
  ;;      others), and can be configured to recognize any additional labeled
  ;;      environments you have defined yourself (variable
  ;;      `reftex-label-alist').
! ;;
  ;;         * Creating Labels
  ;;           Type `C-c (' (`reftex-label') to insert a label at point.
  ;;           RefTeX will either
***************
*** 131,147 ****
  ;;                tables) or
  ;;              - insert a simple label made of a prefix and a number (all
  ;;                other environments)
! ;; 
  ;;           Which labels are created how is configurable with the variable
  ;;           `reftex-insert-label-flags'.
! ;; 
  ;;         * Referencing Labels
  ;;           To make a reference, type `C-c )' (`reftex-reference').  This
  ;;           shows an outline of the document with all labels of a certain
  ;;           type (figure, equation,...) and some label context.
  ;;           Selecting a label inserts a `\ref{LABEL}' macro into the
  ;;           original buffer.
! ;; 
  ;;   3. Citations
  ;;      Typing `C-c [' (`reftex-citation') will let you specify a regular
  ;;      expression to search in current BibTeX database files (as
--- 131,147 ----
  ;;                tables) or
  ;;              - insert a simple label made of a prefix and a number (all
  ;;                other environments)
! ;;
  ;;           Which labels are created how is configurable with the variable
  ;;           `reftex-insert-label-flags'.
! ;;
  ;;         * Referencing Labels
  ;;           To make a reference, type `C-c )' (`reftex-reference').  This
  ;;           shows an outline of the document with all labels of a certain
  ;;           type (figure, equation,...) and some label context.
  ;;           Selecting a label inserts a `\ref{LABEL}' macro into the
  ;;           original buffer.
! ;;
  ;;   3. Citations
  ;;      Typing `C-c [' (`reftex-citation') will let you specify a regular
  ;;      expression to search in current BibTeX database files (as
***************
*** 150,156 ****
  ;;      sorted.  The selected article is referenced as `\cite{KEY}' (see
  ;;      the variable `reftex-cite-format' if you want to insert different
  ;;      macros).
! ;; 
  ;;   4. Index Support
  ;;      RefTeX helps to enter index entries.  It also compiles all entries
  ;;      into an alphabetically sorted `*Index*' buffer which you can use
--- 150,156 ----
  ;;      sorted.  The selected article is referenced as `\cite{KEY}' (see
  ;;      the variable `reftex-cite-format' if you want to insert different
  ;;      macros).
! ;;
  ;;   4. Index Support
  ;;      RefTeX helps to enter index entries.  It also compiles all entries
  ;;      into an alphabetically sorted `*Index*' buffer which you can use
***************
*** 158,182 ****
  ;;      index macros and can be configured to recognize any additional
  ;;      macros you have defined (`reftex-index-macros').  Multiple indices
  ;;      are supported.
! ;; 
  ;;         * Creating Index Entries
  ;;           To index the current selection or the word at point, type
  ;;           `C-c /' (`reftex-index-selection-or-word').  The default macro
  ;;           `reftex-index-default-macro' will be used.  For a more
  ;;           complex entry type `C-c <' (`reftex-index'), select any of
  ;;           the index macros and enter the arguments with completion.
! ;; 
  ;;         * The Index Phrases File (Delayed Indexing)
  ;;           Type `C-c \' (`reftex-index-phrase-selection-or-word') to add
  ;;           the current word or selection to a special _index phrase
  ;;           file_.  RefTeX can later search the document for occurrences
  ;;           of these phrases and let you interactively index the matches.
! ;; 
  ;;         * Displaying and Editing the Index
  ;;           To display the compiled index in a special buffer, type `C-c
  ;;           >' (`reftex-display-index').  From that buffer you can check
  ;;           and edit all entries.
! ;; 
  ;;   5. Viewing Cross-References
  ;;      When point is on the KEY argument of a cross-referencing macro
  ;;      (`\label', `\ref', `\cite', `\bibitem', `\index', and variations)
--- 158,182 ----
  ;;      index macros and can be configured to recognize any additional
  ;;      macros you have defined (`reftex-index-macros').  Multiple indices
  ;;      are supported.
! ;;
  ;;         * Creating Index Entries
  ;;           To index the current selection or the word at point, type
  ;;           `C-c /' (`reftex-index-selection-or-word').  The default macro
  ;;           `reftex-index-default-macro' will be used.  For a more
  ;;           complex entry type `C-c <' (`reftex-index'), select any of
  ;;           the index macros and enter the arguments with completion.
! ;;
  ;;         * The Index Phrases File (Delayed Indexing)
  ;;           Type `C-c \' (`reftex-index-phrase-selection-or-word') to add
  ;;           the current word or selection to a special _index phrase
  ;;           file_.  RefTeX can later search the document for occurrences
  ;;           of these phrases and let you interactively index the matches.
! ;;
  ;;         * Displaying and Editing the Index
  ;;           To display the compiled index in a special buffer, type `C-c
  ;;           >' (`reftex-display-index').  From that buffer you can check
  ;;           and edit all entries.
! ;;
  ;;   5. Viewing Cross-References
  ;;      When point is on the KEY argument of a cross-referencing macro
  ;;      (`\label', `\ref', `\cite', `\bibitem', `\index', and variations)
***************
*** 186,199 ****
  ;;      When the enclosing macro is `\cite' or `\ref' and no other message
  ;;      occupies the echo area, information about the citation or label
  ;;      will automatically be displayed in the echo area.
! ;; 
  ;;   6. Multifile Documents
  ;;      Multifile Documents are fully supported.  The included files must
  ;;      have a file variable `TeX-master' or `tex-main-file' pointing to
  ;;      the master file.  RefTeX provides cross-referencing information
  ;;      from all parts of the document, and across document borders
  ;;      (`xr.sty').
! ;; 
  ;;   7. Document Parsing
  ;;      RefTeX needs to parse the document in order to find labels and
  ;;      other information.  It does it automatically once and updates its
--- 186,199 ----
  ;;      When the enclosing macro is `\cite' or `\ref' and no other message
  ;;      occupies the echo area, information about the citation or label
  ;;      will automatically be displayed in the echo area.
! ;;
  ;;   6. Multifile Documents
  ;;      Multifile Documents are fully supported.  The included files must
  ;;      have a file variable `TeX-master' or `tex-main-file' pointing to
  ;;      the master file.  RefTeX provides cross-referencing information
  ;;      from all parts of the document, and across document borders
  ;;      (`xr.sty').
! ;;
  ;;   7. Document Parsing
  ;;      RefTeX needs to parse the document in order to find labels and
  ;;      other information.  It does it automatically once and updates its
***************
*** 202,224 ****
  ;;      with a raw `C-u' prefix, or press the `r' key in the label
  ;;      selection buffer, the table of contents buffer, or the index
  ;;      buffer.
! ;; 
  ;;   8. AUCTeX
  ;;      If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it
  ;;      (see variable `reftex-plug-into-AUCTeX').  AUCTeX contains style
  ;;      files which trigger appropriate settings in RefTeX, so that for
  ;;      many of the popular LaTeX packages no additional customizations
  ;;      will be necessary.
! ;; 
  ;;   9. Useful Settings
  ;;      To make RefTeX faster for large documents, try these:
  ;;           (setq reftex-enable-partial-scans t)
  ;;           (setq reftex-save-parse-info t)
  ;;           (setq reftex-use-multiple-selection-buffers t)
! ;; 
  ;;      To integrate with AUCTeX, use
  ;;           (setq reftex-plug-into-AUCTeX t)
! ;; 
  ;;      To make your own LaTeX macro definitions known to RefTeX,
  ;;      customize the variables
  ;;           `reftex-label-alist'          (for label macros/environments)
--- 202,224 ----
  ;;      with a raw `C-u' prefix, or press the `r' key in the label
  ;;      selection buffer, the table of contents buffer, or the index
  ;;      buffer.
! ;;
  ;;   8. AUCTeX
  ;;      If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it
  ;;      (see variable `reftex-plug-into-AUCTeX').  AUCTeX contains style
  ;;      files which trigger appropriate settings in RefTeX, so that for
  ;;      many of the popular LaTeX packages no additional customizations
  ;;      will be necessary.
! ;;
  ;;   9. Useful Settings
  ;;      To make RefTeX faster for large documents, try these:
  ;;           (setq reftex-enable-partial-scans t)
  ;;           (setq reftex-save-parse-info t)
  ;;           (setq reftex-use-multiple-selection-buffers t)
! ;;
  ;;      To integrate with AUCTeX, use
  ;;           (setq reftex-plug-into-AUCTeX t)
! ;;
  ;;      To make your own LaTeX macro definitions known to RefTeX,
  ;;      customize the variables
  ;;           `reftex-label-alist'          (for label macros/environments)
***************
*** 228,234 ****
  ;;           `reftex-index-default-macro'  (to set the default macro)
  ;;      If you have a large number of macros defined, you may want to write
  ;;      an AUCTeX style file to support them with both AUCTeX and RefTeX.
! ;; 
  ;;  10. Where Next?
  ;;      Go ahead and use RefTeX.  Use its menus until you have picked up
  ;;      the key bindings.  For an overview of what you can do in each of
--- 228,234 ----
  ;;           `reftex-index-default-macro'  (to set the default macro)
  ;;      If you have a large number of macros defined, you may want to write
  ;;      an AUCTeX style file to support them with both AUCTeX and RefTeX.
! ;;
  ;;  10. Where Next?
  ;;      Go ahead and use RefTeX.  Use its menus until you have picked up
  ;;      the key bindings.  For an overview of what you can do in each of
***************
*** 237,243 ****
  ;;      The first part of the manual explains in a tutorial way how to use
  ;;      and customize RefTeX.  The second part is a command and variable
  ;;      reference.
! ;; 
  ;;---------------------------------------------------------------------------
  ;;
  ;; AUTHOR
--- 237,243 ----
  ;;      The first part of the manual explains in a tutorial way how to use
  ;;      and customize RefTeX.  The second part is a command and variable
  ;;      reference.
! ;;
  ;;---------------------------------------------------------------------------
  ;;
  ;; AUTHOR
***************
*** 319,325 ****
    (setq reftex-syntax-table (copy-syntax-table))
    (modify-syntax-entry ?\( "." reftex-syntax-table)
    (modify-syntax-entry ?\) "." reftex-syntax-table))
!         
  (unless reftex-syntax-table-for-bib
    (setq reftex-syntax-table-for-bib
          (copy-syntax-table reftex-syntax-table))
--- 319,325 ----
    (setq reftex-syntax-table (copy-syntax-table))
    (modify-syntax-entry ?\( "." reftex-syntax-table)
    (modify-syntax-entry ?\) "." reftex-syntax-table))
! 
  (unless reftex-syntax-table-for-bib
    (setq reftex-syntax-table-for-bib
          (copy-syntax-table reftex-syntax-table))
***************
*** 395,401 ****
          (setq reftex-syntax-table (copy-syntax-table (syntax-table)))
          (modify-syntax-entry ?\( "." reftex-syntax-table)
          (modify-syntax-entry ?\) "." reftex-syntax-table)
!         
          (setq reftex-syntax-table-for-bib
                (copy-syntax-table reftex-syntax-table))
          (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
--- 395,401 ----
          (setq reftex-syntax-table (copy-syntax-table (syntax-table)))
          (modify-syntax-entry ?\( "." reftex-syntax-table)
          (modify-syntax-entry ?\) "." reftex-syntax-table)
! 
          (setq reftex-syntax-table-for-bib
                (copy-syntax-table reftex-syntax-table))
          (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
***************
*** 536,542 ****
        ((master
          (cond
           ((fboundp 'TeX-master-file) ; AUCTeX is loaded.  Use its mechanism.
!           (condition-case nil 
                (TeX-master-file t)
              (error (buffer-file-name))))
           ((fboundp 'tex-main-file) (tex-main-file)) ; Emacs LaTeX mode
--- 536,542 ----
        ((master
          (cond
           ((fboundp 'TeX-master-file) ; AUCTeX is loaded.  Use its mechanism.
!           (condition-case nil
                (TeX-master-file t)
              (error (buffer-file-name))))
           ((fboundp 'tex-main-file) (tex-main-file)) ; Emacs LaTeX mode
***************
*** 737,750 ****
  
  ;; A list of all variables in the cache.
  ;; The cache is used to save the compiled versions of some variables.
! (defconst reftex-cache-variables 
    '(reftex-memory ;; This MUST ALWAYS be the first!
!     
      ;; Outline
      reftex-section-levels-all
  
      ;; Labels
!     reftex-env-or-mac-alist 
      reftex-special-env-parsers
      reftex-macros-with-labels
      reftex-label-mac-list
--- 737,750 ----
  
  ;; A list of all variables in the cache.
  ;; The cache is used to save the compiled versions of some variables.
! (defconst reftex-cache-variables
    '(reftex-memory ;; This MUST ALWAYS be the first!
! 
      ;; Outline
      reftex-section-levels-all
  
      ;; Labels
!     reftex-env-or-mac-alist
      reftex-special-env-parsers
      reftex-macros-with-labels
      reftex-label-mac-list
***************
*** 761,767 ****
      reftex-index-macro-alist
      reftex-macros-with-index
      reftex-query-index-macro-prompt
!     reftex-query-index-macro-help 
      reftex-key-to-index-macro-alist
  
      ;; Regular expressions
--- 761,767 ----
      reftex-index-macro-alist
      reftex-macros-with-index
      reftex-query-index-macro-prompt
!     reftex-query-index-macro-help
      reftex-key-to-index-macro-alist
  
      ;; Regular expressions
***************
*** 806,812 ****
       (t (reftex-compile-variables)))))
  
  (defun reftex-reset-mode ()
!   "Reset RefTeX Mode.  
  This will re-compile the configuration information and remove all
  current scanning information and the parse file to enforce a rescan
  on next use."
--- 806,812 ----
       (t (reftex-compile-variables)))))
  
  (defun reftex-reset-mode ()
!   "Reset RefTeX Mode.
  This will re-compile the configuration information and remove all
  current scanning information and the parse file to enforce a rescan
  on next use."
***************
*** 857,868 ****
  
  (defun reftex-erase-all-selection-and-index-buffers ()
    ;; Remove all selection buffers associated with current document.
!   (mapcar 
     (lambda (type)
       (reftex-erase-buffer (reftex-make-selection-buffer-name type)))
     reftex-typekey-list)
    ;; Kill all index buffers
!   (mapcar 
     (lambda (tag)
       (reftex-kill-buffer (reftex-make-index-buffer-name tag)))
     (cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol)))))
--- 857,868 ----
  
  (defun reftex-erase-all-selection-and-index-buffers ()
    ;; Remove all selection buffers associated with current document.
!   (mapcar
     (lambda (type)
       (reftex-erase-buffer (reftex-make-selection-buffer-name type)))
     reftex-typekey-list)
    ;; Kill all index buffers
!   (mapcar
     (lambda (tag)
       (reftex-kill-buffer (reftex-make-index-buffer-name tag)))
     (cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol)))))
***************
*** 878,884 ****
  
    ;; Record that we have done this, and what we have used.
    (setq reftex-tables-dirty nil)
!   (setq reftex-memory 
          (list reftex-label-alist
                (get reftex-docstruct-symbol 'reftex-section-levels)
                (get reftex-docstruct-symbol 'reftex-label-alist-style)
--- 878,884 ----
  
    ;; Record that we have done this, and what we have used.
    (setq reftex-tables-dirty nil)
!   (setq reftex-memory
          (list reftex-label-alist
                (get reftex-docstruct-symbol 'reftex-section-levels)
                (get reftex-docstruct-symbol 'reftex-label-alist-style)
***************
*** 897,903 ****
                '(nil)))
          (all-index (reftex-uniquify-by-car
                      (reftex-splice-symbols-into-list
!                      (append reftex-index-macros 
                               (get reftex-docstruct-symbol
                                    'reftex-index-macros-style)
                               '(default))
--- 897,903 ----
                '(nil)))
          (all-index (reftex-uniquify-by-car
                      (reftex-splice-symbols-into-list
!                      (append reftex-index-macros
                               (get reftex-docstruct-symbol
                                    'reftex-index-macros-style)
                               '(default))
***************
*** 908,914 ****
          macro verify repeat nindex tag key toc-level toc-levels)
  
      (setq reftex-words-to-typekey-alist nil
!           reftex-prefix-to-typekey-alist 
            '(("sec:" . "s") ("cha:" . "s") ("chap:" . "s"))
            reftex-typekey-list nil
            reftex-typekey-to-format-alist nil
--- 908,914 ----
          macro verify repeat nindex tag key toc-level toc-levels)
  
      (setq reftex-words-to-typekey-alist nil
!           reftex-prefix-to-typekey-alist
            '(("sec:" . "s") ("cha:" . "s") ("chap:" . "s"))
            reftex-typekey-list nil
            reftex-typekey-to-format-alist nil
***************
*** 964,970 ****
           ((symbolp env-or-mac)
            ;; A special parser function
            (unless (fboundp env-or-mac)
!             (message "Warning: %s does not seem to be a valid function" 
                       env-or-mac))
            (setq nargs nil nlabel nil opt-args nil)
            (add-to-list 'reftex-special-env-parsers env-or-mac)
--- 964,970 ----
           ((symbolp env-or-mac)
            ;; A special parser function
            (unless (fboundp env-or-mac)
!             (message "Warning: %s does not seem to be a valid function"
                       env-or-mac))
            (setq nargs nil nlabel nil opt-args nil)
            (add-to-list 'reftex-special-env-parsers env-or-mac)
***************
*** 992,999 ****
                             (push (cons string toc-level) toc-levels))))))))
          ;; Translate some special context cases
          (when (assq context reftex-default-context-regexps)
!           (setq context 
!                 (format 
                   (cdr (assq context reftex-default-context-regexps))
                   (regexp-quote env-or-mac))))
          ;; See if this is the first format for this typekey
--- 992,999 ----
                             (push (cons string toc-level) toc-levels))))))))
          ;; Translate some special context cases
          (when (assq context reftex-default-context-regexps)
!           (setq context
!                 (format
                   (cdr (assq context reftex-default-context-regexps))
                   (regexp-quote env-or-mac))))
          ;; See if this is the first format for this typekey
***************
*** 1026,1032 ****
            (nreverse reftex-typekey-to-prefix-alist))
  
      ;; Prepare the typekey query prompt and help string.
!     (setq qh-list 
            (sort qh-list
                  (lambda (x1 x2)
                    (string< (downcase (car x1)) (downcase (car x2))))))
--- 1026,1032 ----
            (nreverse reftex-typekey-to-prefix-alist))
  
      ;; Prepare the typekey query prompt and help string.
!     (setq qh-list
            (sort qh-list
                  (lambda (x1 x2)
                    (string< (downcase (car x1)) (downcase (car x2))))))
***************
*** 1037,1043 ****
                    "]"))
      ;; In the help string, we need to wrap lines...
      (setq reftex-type-query-help
!           (concat 
             "SELECT A LABEL TYPE:\n--------------------\n"
             (mapconcat
              (lambda(x)
--- 1037,1043 ----
                    "]"))
      ;; In the help string, we need to wrap lines...
      (setq reftex-type-query-help
!           (concat
             "SELECT A LABEL TYPE:\n--------------------\n"
             (mapconcat
              (lambda(x)
***************
*** 1057,1063 ****
      ;; which allow for some chars from the ref format to be in the buffer.
      ;; These characters will be seen and removed.
      (setq reftex-words-to-typekey-alist
!           (mapcar 
             (lambda (x)
               (setq word (car x)
                     typekey (cdr x)
--- 1057,1063 ----
      ;; which allow for some chars from the ref format to be in the buffer.
      ;; These characters will be seen and removed.
      (setq reftex-words-to-typekey-alist
!           (mapcar
             (lambda (x)
               (setq word (car x)
                     typekey (cdr x)
***************
*** 1110,1127 ****
      (setq reftex-key-to-index-macro-alist
            (sort reftex-key-to-index-macro-alist
                  (lambda (a b) (< (downcase (car a)) (downcase (car b))))))
!     (setq reftex-query-index-macro-prompt 
            (concat "Index macro: ["
                    (mapconcat (lambda (x) (char-to-string (car x)))
                               reftex-key-to-index-macro-alist "")
                    "]"))
      (setq i 0
            reftex-query-index-macro-help
!           (concat 
             "SELECT A MACRO:\n---------------\n"
             (mapconcat
              (lambda(x)
!               (format "[%c] %-20.20s%s" (car x) (nth 1 x) 
                        (if (= 0 (mod (incf i) 3)) "\n" "")))
              reftex-key-to-index-macro-alist "")))
  
--- 1110,1127 ----
      (setq reftex-key-to-index-macro-alist
            (sort reftex-key-to-index-macro-alist
                  (lambda (a b) (< (downcase (car a)) (downcase (car b))))))
!     (setq reftex-query-index-macro-prompt
            (concat "Index macro: ["
                    (mapconcat (lambda (x) (char-to-string (car x)))
                               reftex-key-to-index-macro-alist "")
                    "]"))
      (setq i 0
            reftex-query-index-macro-help
!           (concat
             "SELECT A MACRO:\n---------------\n"
             (mapconcat
              (lambda(x)
!               (format "[%c] %-20.20s%s" (car x) (nth 1 x)
                        (if (= 0 (mod (incf i) 3)) "\n" "")))
              reftex-key-to-index-macro-alist "")))
  
***************
*** 1135,1145 ****
      (let* (
  ;          (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
             (wbol "\\(^\\)[ \t]*")  ; Need to keep the empty group because
!                                   ;;; because match number are hard coded  
             (label-re "\\\\label{\\([^}]*\\)}")
!            (include-re (concat wbol 
                                 "\\\\\\("
!                                (mapconcat 'identity 
                                            reftex-include-file-commands "\\|")
                                 "\\)[{ \t]+\\([^} \t\n\r]+\\)"))
             (section-re
--- 1135,1145 ----
      (let* (
  ;          (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
             (wbol "\\(^\\)[ \t]*")  ; Need to keep the empty group because
!                                   ;;; because match number are hard coded
             (label-re "\\\\label{\\([^}]*\\)}")
!            (include-re (concat wbol
                                 "\\\\\\("
!                                (mapconcat 'identity
                                            reftex-include-file-commands "\\|")
                                 "\\)[{ \t]+\\([^} \t\n\r]+\\)"))
             (section-re
***************
*** 1193,1199 ****
              reftex-macros-with-labels macros-with-labels
              reftex-find-index-entry-regexp-format find-index-re-format
              reftex-find-label-regexp-format find-label-re-format
!             reftex-find-label-regexp-format2 
              "\\([]} \t\n\r]\\)\\([[{]\\)\\(%s\\)[]}]")
        (message "Compiling label environment definitions...done")))
    (put reftex-docstruct-symbol 'reftex-cache
--- 1193,1199 ----
              reftex-macros-with-labels macros-with-labels
              reftex-find-index-entry-regexp-format find-index-re-format
              reftex-find-label-regexp-format find-label-re-format
!             reftex-find-label-regexp-format2
              "\\([]} \t\n\r]\\)\\([[{]\\)\\(%s\\)[]}]")
        (message "Compiling label environment definitions...done")))
    (put reftex-docstruct-symbol 'reftex-cache
***************
*** 1232,1238 ****
    ;; Error out in a buffer without a file.
    (if (and reftex-mode
           (not (buffer-file-name)))
!       (error "RefTeX works only in buffers visiting a file."))
  
    ;; Make sure we have the symbols tied
    (if (eq reftex-docstruct-symbol nil)
--- 1232,1238 ----
    ;; Error out in a buffer without a file.
    (if (and reftex-mode
           (not (buffer-file-name)))
!       (error "RefTeX works only in buffers visiting a file"))
  
    ;; Make sure we have the symbols tied
    (if (eq reftex-docstruct-symbol nil)
***************
*** 1270,1276 ****
    (and (symbolp reftex-docstruct-symbol)
         (symbol-value reftex-docstruct-symbol)
         t))
!   
  (defun reftex-silence-toc-markers (list n)
    ;; Set all toc markers in the first N entries in list to nil
    (while (and list (> (decf n) -1))
--- 1270,1276 ----
    (and (symbolp reftex-docstruct-symbol)
         (symbol-value reftex-docstruct-symbol)
         t))
! 
  (defun reftex-silence-toc-markers (list n)
    ;; Set all toc markers in the first N entries in list to nil
    (while (and list (> (decf n) -1))
***************
*** 1287,1293 ****
           (master (reftex-TeX-master-file))
           (enable-local-variables nil)
           (file (if (string-match "\\.[a-zA-Z]+\\'" master)
!                    (concat (substring master 0 (match-beginning 0)) 
                             reftex-parse-file-extension)
                   (concat master reftex-parse-file-extension))))
      (cond
--- 1287,1293 ----
           (master (reftex-TeX-master-file))
           (enable-local-variables nil)
           (file (if (string-match "\\.[a-zA-Z]+\\'" master)
!                    (concat (substring master 0 (match-beginning 0))
                             reftex-parse-file-extension)
                   (concat master reftex-parse-file-extension))))
      (cond
***************
*** 1366,1372 ****
  
    ;; Check if the master is the same: when moving a document, this will see 
it.
    (let* ((real-master (reftex-TeX-master-file))
!          (parsed-master 
            (nth 1 (assq 'bof (symbol-value reftex-docstruct-symbol)))))
      (unless (string= (file-truename real-master) (file-truename 
parsed-master))
        (message "Master file name in load file is different: %s versus %s"
--- 1366,1372 ----
  
    ;; Check if the master is the same: when moving a document, this will see 
it.
    (let* ((real-master (reftex-TeX-master-file))
!          (parsed-master
            (nth 1 (assq 'bof (symbol-value reftex-docstruct-symbol)))))
      (unless (string= (file-truename real-master) (file-truename 
parsed-master))
        (message "Master file name in load file is different: %s versus %s"
***************
*** 1386,1392 ****
  (defun reftex-select-external-document (xr-alist xr-index)
    ;; Return index of an external document.
    (let* ((len (length xr-alist)) (highest (1- (+ ?0 len)))
!          (prompt (format "[%c-%c] Select    TAB: Read prefix with completion" 
                           ?0 highest))
           key prefix)
      (cond
--- 1386,1392 ----
  (defun reftex-select-external-document (xr-alist xr-index)
    ;; Return index of an external document.
    (let* ((len (length xr-alist)) (highest (1- (+ ?0 len)))
!          (prompt (format "[%c-%c] Select    TAB: Read prefix with completion"
                           ?0 highest))
           key prefix)
      (cond
***************
*** 1397,1403 ****
        (- 1 xr-index))
       (t
        (save-excursion
!         (let* ((length (apply 'max (mapcar 
                                      (lambda(x) (length (car x))) xr-alist)))
                 (fmt (format " [%%c]  %%-%ds  %%s\n" length))
                 (n (1- ?0)))
--- 1397,1403 ----
        (- 1 xr-index))
       (t
        (save-excursion
!         (let* ((length (apply 'max (mapcar
                                      (lambda(x) (length (car x))) xr-alist)))
                 (fmt (format " [%%c]  %%-%ds  %%s\n" length))
                 (n (1- ?0)))
***************
*** 1407,1413 ****
                   (concat
                    "SELECT EXTERNAL DOCUMENT\n------------------------\n"
                    (mapconcat
!                    (lambda (x) 
                       (format fmt (incf n) (or (car x) "")
                               (abbreviate-file-name (cdr x))))
                     xr-alist ""))
--- 1407,1413 ----
                   (concat
                    "SELECT EXTERNAL DOCUMENT\n------------------------\n"
                    (mapconcat
!                    (lambda (x)
                       (format fmt (incf n) (or (car x) "")
                               (abbreviate-file-name (cdr x))))
                     xr-alist ""))
***************
*** 1431,1437 ****
    (let* ((rec-values (if reftex-search-unrecursed-path-first '(nil t) '(t)))
           (extensions (cdr (assoc type reftex-file-extensions)))
           (def-ext (car extensions))
!          (ext-re (concat "\\(" 
                           (mapconcat 'regexp-quote extensions "\\|")
                           "\\)\\'"))
           (files (if (string-match ext-re file)
--- 1431,1437 ----
    (let* ((rec-values (if reftex-search-unrecursed-path-first '(nil t) '(t)))
           (extensions (cdr (assoc type reftex-file-extensions)))
           (def-ext (car extensions))
!          (ext-re (concat "\\("
                           (mapconcat 'regexp-quote extensions "\\|")
                           "\\)\\'"))
           (files (if (string-match ext-re file)
***************
*** 1440,1447 ****
           path old-path file1)
      (cond
       ((file-name-absolute-p file)
!       (setq file1 
!             (or 
               (and (car files) (file-regular-p (car files)) (car files))
               (and (cdr files) (file-regular-p (cdr files)) (cdr files)))))
       ((and reftex-use-external-file-finders
--- 1440,1447 ----
           path old-path file1)
      (cond
       ((file-name-absolute-p file)
!       (setq file1
!             (or
               (and (car files) (file-regular-p (car files)) (car files))
               (and (cdr files) (file-regular-p (cdr files)) (cdr files)))))
       ((and reftex-use-external-file-finders
***************
*** 1456,1465 ****
              (setq old-path path
                    path (cons master-dir path)
                    file1 (or (and (car files)
!                                  (reftex-find-file-on-path 
                                    (car files) path master-dir))
                              (and (cdr files)
!                                  (reftex-find-file-on-path 
                                    (cdr files) path master-dir))))))))
      (cond (file1 file1)
            (die (error "No such file: %s" file) nil)
--- 1456,1465 ----
              (setq old-path path
                    path (cons master-dir path)
                    file1 (or (and (car files)
!                                  (reftex-find-file-on-path
                                    (car files) path master-dir))
                              (and (cdr files)
!                                  (reftex-find-file-on-path
                                    (cdr files) path master-dir))))))))
      (cond (file1 file1)
            (die (error "No such file: %s" file) nil)
***************
*** 1504,1510 ****
             (reftex-uniquify
              (reftex-parse-colon-path
               (mapconcat
!               (lambda(x) 
                  (if (string-match "^!" x)
                      (apply 'reftex-process-string
                             (split-string (substring x 1)))
--- 1504,1510 ----
             (reftex-uniquify
              (reftex-parse-colon-path
               (mapconcat
!               (lambda(x)
                  (if (string-match "^!" x)
                      (apply 'reftex-process-string
                             (split-string (substring x 1)))
***************
*** 1513,1519 ****
                ;;  (cdr (assoc type reftex-path-environment))
                ;; However, historically we have separate options for the
                ;; environment variables, so we have to do this:
!               (symbol-value (intern (concat "reftex-" type 
                                              "path-environment-variables")))
                path-separator))))
        (put pathvar 'status 'split)
--- 1513,1519 ----
                ;;  (cdr (assoc type reftex-path-environment))
                ;; However, historically we have separate options for the
                ;; environment variables, so we have to do this:
!               (symbol-value (intern (concat "reftex-" type
                                              "path-environment-variables")))
                path-separator))))
        (put pathvar 'status 'split)
***************
*** 1539,1549 ****
            ;; or:     Relative recursive path elements need to be expanded
            ;;         relative to new default directory
            (message "Expanding search path to find %s file: %s ..." type file)
!           (put pathvar 'recursive-path 
                 (reftex-expand-path (symbol-value pathvar) master-dir))
            (put pathvar 'master-dir master-dir)
            (get pathvar 'recursive-path))
!          (t 
            ;; Recursive path computed earlier is still OK.
            (get pathvar 'recursive-path)))
        ;; The simple path was requested
--- 1539,1549 ----
            ;; or:     Relative recursive path elements need to be expanded
            ;;         relative to new default directory
            (message "Expanding search path to find %s file: %s ..." type file)
!           (put pathvar 'recursive-path
                 (reftex-expand-path (symbol-value pathvar) master-dir))
            (put pathvar 'master-dir master-dir)
            (get pathvar 'recursive-path))
!          (t
            ;; Recursive path computed earlier is still OK.
            (get pathvar 'recursive-path)))
        ;; The simple path was requested
***************
*** 1572,1578 ****
    ;; Trailing ! or !! will be converted into `//' (emTeX convention)
    (mapcar
     (lambda (dir)
!      (if (string-match "\\(//+\\|/*!+\\)\\'" dir) 
           (setq dir (replace-match "//" t t dir)))
       (file-name-as-directory dir))
     (delete "" (split-string path (concat path-separator "+")))))
--- 1572,1578 ----
    ;; Trailing ! or !! will be converted into `//' (emTeX convention)
    (mapcar
     (lambda (dir)
!      (if (string-match "\\(//+\\|/*!+\\)\\'" dir)
           (setq dir (replace-match "//" t t dir)))
       (file-name-as-directory dir))
     (delete "" (split-string path (concat path-separator "+")))))
***************
*** 1601,1607 ****
        (when (file-directory-p dir)
          (setq files (nreverse (directory-files dir t "[^.]")))
          (while (setq file (pop files))
!           (if (file-directory-p file) 
                (push (file-name-as-directory file) path)))
          (push dir path1)))
      path1))
--- 1601,1607 ----
        (when (file-directory-p dir)
          (setq files (nreverse (directory-files dir t "[^.]")))
          (while (setq file (pop files))
!           (if (file-directory-p file)
                (push (file-name-as-directory file) path)))
          (push dir path1)))
      path1))
***************
*** 1664,1670 ****
    "Show the table of contents for the current document." t)
  (autoload 'reftex-toc-recenter "reftex-toc"
    "Display the TOC window and highlight line corresponding to current 
position." t)
! (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" 
    "Toggle automatic recentering of TOC window." t)
  
  ;;; =========================================================================
--- 1664,1670 ----
    "Show the table of contents for the current document." t)
  (autoload 'reftex-toc-recenter "reftex-toc"
    "Display the TOC window and highlight line corresponding to current 
position." t)
! (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc"
    "Toggle automatic recentering of TOC window." t)
  
  ;;; =========================================================================
***************
*** 1883,1889 ****
      (while list
        (if (funcall predicate (car list))
            (push (if completion
!                     (list (nth nth (car list))) 
                    (nth nth (car list)))
                  rtn))
        (setq list (cdr list)))
--- 1883,1889 ----
      (while list
        (if (funcall predicate (car list))
            (push (if completion
!                     (list (nth nth (car list)))
                    (nth nth (car list)))
                  rtn))
        (setq list (cdr list)))
***************
*** 1919,1925 ****
    ;; If POS is given, calculate distances relative to it.
    ;; Return nil if there is no match.
    (let ((pos (point))
!         (dist (or max-length (length regexp)))  
          match1 match2 match)
      (goto-char (min (+ pos dist) (point-max)))
      (when (re-search-backward regexp nil t)
--- 1919,1925 ----
    ;; If POS is given, calculate distances relative to it.
    ;; Return nil if there is no match.
    (let ((pos (point))
!         (dist (or max-length (length regexp)))
          match1 match2 match)
      (goto-char (min (+ pos dist) (point-max)))
      (when (re-search-backward regexp nil t)
***************
*** 2005,2014 ****
                  ((and scroll (equal char ?\C-? ))
                   (condition-case nil (scroll-down) (error nil))
                   (message prompt))
!                 (t (message "") 
                     (throw 'exit char)))
            (setq char (read-char-exclusive)))))))
!       
  
  (defun reftex-make-regexp-allow-for-ctrl-m (string)
    ;; convert STRING into a regexp, allowing ^M for \n and vice versa
--- 2005,2014 ----
                  ((and scroll (equal char ?\C-? ))
                   (condition-case nil (scroll-down) (error nil))
                   (message prompt))
!                 (t (message "")
                     (throw 'exit char)))
            (setq char (read-char-exclusive)))))))
! 
  
  (defun reftex-make-regexp-allow-for-ctrl-m (string)
    ;; convert STRING into a regexp, allowing ^M for \n and vice versa
***************
*** 2206,2215 ****
      ;; Restrict number of words
      (if (> (length words) nwords)
          (setcdr (nthcdr (1- nwords) words) nil))
!     
      ;; First, try to use all words
      (setq string (mapconcat 'identity words sep))
!   
      ;; Abbreviate words if enforced by user settings or string length
      (if (or (eq t abbrev)
              (and abbrev
--- 2206,2215 ----
      ;; Restrict number of words
      (if (> (length words) nwords)
          (setcdr (nthcdr (1- nwords) words) nil))
! 
      ;; First, try to use all words
      (setq string (mapconcat 'identity words sep))
! 
      ;; Abbreviate words if enforced by user settings or string length
      (if (or (eq t abbrev)
              (and abbrev
***************
*** 2301,2307 ****
                (font-lock-set-defaults-1)
                (reftex-select-font-lock-fontify-region (point-min) 
(point-max))))
             (t
!             ;; Oops? 
              (message "Sorry: cannot refontify RefTeX Select buffer."))))
        (rename-buffer oldname))))
  
--- 2301,2307 ----
                (font-lock-set-defaults-1)
                (reftex-select-font-lock-fontify-region (point-min) 
(point-max))))
             (t
!             ;; Oops?
              (message "Sorry: cannot refontify RefTeX Select buffer."))))
        (rename-buffer oldname))))
  
***************
*** 2350,2356 ****
  
  ;; Initialize the overlays
  (aset reftex-highlight-overlays 0 (reftex-make-overlay 1 1))
! (reftex-overlay-put (aref reftex-highlight-overlays 0) 
               'face 'highlight)
  (aset reftex-highlight-overlays 1 (reftex-make-overlay 1 1))
  (reftex-overlay-put (aref reftex-highlight-overlays 1)
--- 2350,2356 ----
  
  ;; Initialize the overlays
  (aset reftex-highlight-overlays 0 (reftex-make-overlay 1 1))
! (reftex-overlay-put (aref reftex-highlight-overlays 0)
               'face 'highlight)
  (aset reftex-highlight-overlays 1 (reftex-make-overlay 1 1))
  (reftex-overlay-put (aref reftex-highlight-overlays 1)
***************
*** 2375,2381 ****
  
  ;;; =========================================================================
  ;;;
! ;;; Keybindings 
  
  ;; The default bindings in the mode map.
  (loop for x in
--- 2375,2381 ----
  
  ;;; =========================================================================
  ;;;
! ;;; Keybindings
  
  ;; The default bindings in the mode map.
  (loop for x in
***************
*** 2395,2404 ****
  ;; Bind `reftex-mouse-view-crossref' only when the key is still free
  (if (featurep 'xemacs)
      (unless (key-binding [(shift button2)])
!       (define-key reftex-mode-map [(shift button2)] 
          'reftex-mouse-view-crossref))
    (unless (key-binding [(shift mouse-2)])
!     (define-key reftex-mode-map [(shift mouse-2)] 
        'reftex-mouse-view-crossref)))
  
  ;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map
--- 2395,2404 ----
  ;; Bind `reftex-mouse-view-crossref' only when the key is still free
  (if (featurep 'xemacs)
      (unless (key-binding [(shift button2)])
!       (define-key reftex-mode-map [(shift button2)]
          'reftex-mouse-view-crossref))
    (unless (key-binding [(shift mouse-2)])
!     (define-key reftex-mode-map [(shift mouse-2)]
        'reftex-mouse-view-crossref)))
  
  ;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map
***************
*** 2502,2508 ****
     ("Reference Style"
      ["Default" (setq reftex-vref-is-default nil
                       reftex-fref-is-default nil)
!      :style radio :selected (not (or reftex-vref-is-default 
                                       reftex-fref-is-default))]
      ["Varioref" (setq reftex-vref-is-default t
                        reftex-fref-is-default nil)
--- 2502,2508 ----
     ("Reference Style"
      ["Default" (setq reftex-vref-is-default nil
                       reftex-fref-is-default nil)
!      :style radio :selected (not (or reftex-vref-is-default
                                       reftex-fref-is-default))]
      ["Varioref" (setq reftex-vref-is-default t
                        reftex-fref-is-default nil)
***************
*** 2537,2543 ****
            (list 'reftex-add-index-macros (list 'list (list 'quote (car x))))
            :style 'radio :selected
            (list 'memq (list 'quote (car x))
!                 (list 'get 'reftex-docstruct-symbol 
                        (list 'quote 'reftex-index-macros-style)))))
         reftex-index-macros-builtin))
     "--"
--- 2537,2543 ----
            (list 'reftex-add-index-macros (list 'list (list 'quote (car x))))
            :style 'radio :selected
            (list 'memq (list 'quote (car x))
!                 (list 'get 'reftex-docstruct-symbol
                        (list 'quote 'reftex-index-macros-style)))))
         reftex-index-macros-builtin))
     "--"
***************
*** 2546,2552 ****
     ("Customize"
      ["Browse RefTeX Group" reftex-customize t]
      "--"
!     ["Build Full Customize Menu" reftex-create-customize-menu 
       (fboundp 'customize-menu-create)])
     ("Documentation"
      ["Info" reftex-info t]
--- 2546,2552 ----
     ("Customize"
      ["Browse RefTeX Group" reftex-customize t]
      "--"
!     ["Build Full Customize Menu" reftex-create-customize-menu
       (fboundp 'customize-menu-create)])
     ("Documentation"
      ["Info" reftex-info t]
***************
*** 2562,2568 ****
    (interactive)
    (if (fboundp 'customize-menu-create)
        (progn
!         (easy-menu-change 
           '("Ref") "Customize"
           `(["Browse RefTeX group" reftex-customize t]
             "--"
--- 2562,2568 ----
    (interactive)
    (if (fboundp 'customize-menu-create)
        (progn
!         (easy-menu-change
           '("Ref") "Customize"
           `(["Browse RefTeX group" reftex-customize t]
             "--"
***************
*** 2600,2606 ****
  ;;; That's it! 
----------------------------------------------------------------
  
  (setq reftex-tables-dirty t)  ; in case this file is evaluated by hand
! (provide 'reftex) 
  
  
;;;============================================================================
  
--- 2600,2606 ----
  ;;; That's it! 
----------------------------------------------------------------
  
  (setq reftex-tables-dirty t)  ; in case this file is evaluated by hand
! (provide 'reftex)
  
  
;;;============================================================================
  




reply via email to

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