diff options
| author | Juanma Barranquero | 2005-06-14 15:35:03 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2005-06-14 15:35:03 +0000 |
| commit | 88c31d68c43e8273aa330d2f28535dfa0ccb63de (patch) | |
| tree | 343842297a3e55a5600c3fb9df7c71ad86eaa9cc | |
| parent | 4b9e737811fbf253db0418f2f78be43ee9a5cbf2 (diff) | |
| download | emacs-88c31d68c43e8273aa330d2f28535dfa0ccb63de.tar.gz emacs-88c31d68c43e8273aa330d2f28535dfa0ccb63de.zip | |
(reftex-access-scan-info): Follow error conventions.
| -rw-r--r-- | lisp/textmodes/reftex.el | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index f8b4cba65ae..574c17a07f9 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | ;;--------------------------------------------------------------------------- | 26 | ;;--------------------------------------------------------------------------- |
| 27 | ;; | 27 | ;; |
| 28 | ;;; Commentary: | 28 | ;;; Commentary: |
| 29 | ;; | 29 | ;; |
| 30 | ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite, | 30 | ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite, |
| 31 | ;; and \index commands in (multi-file) LaTeX documents. | 31 | ;; and \index commands in (multi-file) LaTeX documents. |
| 32 | ;; - A table of contents provides easy access to any part of a document. | 32 | ;; - A table of contents provides easy access to any part of a document. |
| @@ -71,7 +71,7 @@ | |||
| 71 | ;; | 71 | ;; |
| 72 | ;; Introduction | 72 | ;; Introduction |
| 73 | ;; ************ | 73 | ;; ************ |
| 74 | ;; | 74 | ;; |
| 75 | ;; RefTeX is a specialized package for support of labels, references, | 75 | ;; RefTeX is a specialized package for support of labels, references, |
| 76 | ;; citations, and the index in LaTeX. RefTeX wraps itself round 4 LaTeX | 76 | ;; citations, and the index in LaTeX. RefTeX wraps itself round 4 LaTeX |
| 77 | ;; macros: `\label', `\ref', `\cite', and `\index'. Using these macros | 77 | ;; macros: `\label', `\ref', `\cite', and `\index'. Using these macros |
| @@ -80,13 +80,13 @@ | |||
| 80 | ;; time-consuming tasks almost entirely. It also provides functions to | 80 | ;; time-consuming tasks almost entirely. It also provides functions to |
| 81 | ;; display the structure of a document and to move around in this | 81 | ;; display the structure of a document and to move around in this |
| 82 | ;; structure quickly. | 82 | ;; structure quickly. |
| 83 | ;; | 83 | ;; |
| 84 | ;; *Note Imprint::, for information about who to contact for help, bug | 84 | ;; *Note Imprint::, for information about who to contact for help, bug |
| 85 | ;; reports or suggestions. | 85 | ;; reports or suggestions. |
| 86 | ;; | 86 | ;; |
| 87 | ;; Environment | 87 | ;; Environment |
| 88 | ;; =========== | 88 | ;; =========== |
| 89 | ;; | 89 | ;; |
| 90 | ;; RefTeX needs to access all files which are part of a multifile | 90 | ;; RefTeX needs to access all files which are part of a multifile |
| 91 | ;; document, and the BibTeX database files requested by the | 91 | ;; document, and the BibTeX database files requested by the |
| 92 | ;; `\bibliography' command. To find these files, RefTeX will require a | 92 | ;; `\bibliography' command. To find these files, RefTeX will require a |
| @@ -95,26 +95,26 @@ | |||
| 95 | ;; which are also used by RefTeX. However, on some systems these | 95 | ;; which are also used by RefTeX. However, on some systems these |
| 96 | ;; variables do not contain the full search path. If RefTeX does not work | 96 | ;; variables do not contain the full search path. If RefTeX does not work |
| 97 | ;; for you because it cannot find some files, read *Note Finding Files::. | 97 | ;; for you because it cannot find some files, read *Note Finding Files::. |
| 98 | ;; | 98 | ;; |
| 99 | ;; Entering RefTeX Mode | 99 | ;; Entering RefTeX Mode |
| 100 | ;; ==================== | 100 | ;; ==================== |
| 101 | ;; | 101 | ;; |
| 102 | ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x | 102 | ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x |
| 103 | ;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the | 103 | ;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the |
| 104 | ;; following lines to your `.emacs' file: | 104 | ;; following lines to your `.emacs' file: |
| 105 | ;; | 105 | ;; |
| 106 | ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode | 106 | ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode |
| 107 | ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode | 107 | ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode |
| 108 | ;; | 108 | ;; |
| 109 | ;; RefTeX in a Nutshell | 109 | ;; RefTeX in a Nutshell |
| 110 | ;; ==================== | 110 | ;; ==================== |
| 111 | ;; | 111 | ;; |
| 112 | ;; 1. Table of Contents | 112 | ;; 1. Table of Contents |
| 113 | ;; Typing `C-c =' (`reftex-toc') will show a table of contents of the | 113 | ;; Typing `C-c =' (`reftex-toc') will show a table of contents of the |
| 114 | ;; document. This buffer can display sections, labels and index | 114 | ;; document. This buffer can display sections, labels and index |
| 115 | ;; entries defined in the document. From the buffer, you can jump | 115 | ;; entries defined in the document. From the buffer, you can jump |
| 116 | ;; quickly to every part of your document. Press `?' to get help. | 116 | ;; quickly to every part of your document. Press `?' to get help. |
| 117 | ;; | 117 | ;; |
| 118 | ;; 2. Labels and References | 118 | ;; 2. Labels and References |
| 119 | ;; RefTeX helps to create unique labels and to find the correct key | 119 | ;; RefTeX helps to create unique labels and to find the correct key |
| 120 | ;; for references quickly. It distinguishes labels for different | 120 | ;; for references quickly. It distinguishes labels for different |
| @@ -122,7 +122,7 @@ | |||
| 122 | ;; others), and can be configured to recognize any additional labeled | 122 | ;; others), and can be configured to recognize any additional labeled |
| 123 | ;; environments you have defined yourself (variable | 123 | ;; environments you have defined yourself (variable |
| 124 | ;; `reftex-label-alist'). | 124 | ;; `reftex-label-alist'). |
| 125 | ;; | 125 | ;; |
| 126 | ;; * Creating Labels | 126 | ;; * Creating Labels |
| 127 | ;; Type `C-c (' (`reftex-label') to insert a label at point. | 127 | ;; Type `C-c (' (`reftex-label') to insert a label at point. |
| 128 | ;; RefTeX will either | 128 | ;; RefTeX will either |
| @@ -131,17 +131,17 @@ | |||
| 131 | ;; tables) or | 131 | ;; tables) or |
| 132 | ;; - insert a simple label made of a prefix and a number (all | 132 | ;; - insert a simple label made of a prefix and a number (all |
| 133 | ;; other environments) | 133 | ;; other environments) |
| 134 | ;; | 134 | ;; |
| 135 | ;; Which labels are created how is configurable with the variable | 135 | ;; Which labels are created how is configurable with the variable |
| 136 | ;; `reftex-insert-label-flags'. | 136 | ;; `reftex-insert-label-flags'. |
| 137 | ;; | 137 | ;; |
| 138 | ;; * Referencing Labels | 138 | ;; * Referencing Labels |
| 139 | ;; To make a reference, type `C-c )' (`reftex-reference'). This | 139 | ;; To make a reference, type `C-c )' (`reftex-reference'). This |
| 140 | ;; shows an outline of the document with all labels of a certain | 140 | ;; shows an outline of the document with all labels of a certain |
| 141 | ;; type (figure, equation,...) and some label context. | 141 | ;; type (figure, equation,...) and some label context. |
| 142 | ;; Selecting a label inserts a `\ref{LABEL}' macro into the | 142 | ;; Selecting a label inserts a `\ref{LABEL}' macro into the |
| 143 | ;; original buffer. | 143 | ;; original buffer. |
| 144 | ;; | 144 | ;; |
| 145 | ;; 3. Citations | 145 | ;; 3. Citations |
| 146 | ;; Typing `C-c [' (`reftex-citation') will let you specify a regular | 146 | ;; Typing `C-c [' (`reftex-citation') will let you specify a regular |
| 147 | ;; expression to search in current BibTeX database files (as | 147 | ;; expression to search in current BibTeX database files (as |
| @@ -150,7 +150,7 @@ | |||
| 150 | ;; sorted. The selected article is referenced as `\cite{KEY}' (see | 150 | ;; sorted. The selected article is referenced as `\cite{KEY}' (see |
| 151 | ;; the variable `reftex-cite-format' if you want to insert different | 151 | ;; the variable `reftex-cite-format' if you want to insert different |
| 152 | ;; macros). | 152 | ;; macros). |
| 153 | ;; | 153 | ;; |
| 154 | ;; 4. Index Support | 154 | ;; 4. Index Support |
| 155 | ;; RefTeX helps to enter index entries. It also compiles all entries | 155 | ;; RefTeX helps to enter index entries. It also compiles all entries |
| 156 | ;; into an alphabetically sorted `*Index*' buffer which you can use | 156 | ;; into an alphabetically sorted `*Index*' buffer which you can use |
| @@ -158,25 +158,25 @@ | |||
| 158 | ;; index macros and can be configured to recognize any additional | 158 | ;; index macros and can be configured to recognize any additional |
| 159 | ;; macros you have defined (`reftex-index-macros'). Multiple indices | 159 | ;; macros you have defined (`reftex-index-macros'). Multiple indices |
| 160 | ;; are supported. | 160 | ;; are supported. |
| 161 | ;; | 161 | ;; |
| 162 | ;; * Creating Index Entries | 162 | ;; * Creating Index Entries |
| 163 | ;; To index the current selection or the word at point, type | 163 | ;; To index the current selection or the word at point, type |
| 164 | ;; `C-c /' (`reftex-index-selection-or-word'). The default macro | 164 | ;; `C-c /' (`reftex-index-selection-or-word'). The default macro |
| 165 | ;; `reftex-index-default-macro' will be used. For a more | 165 | ;; `reftex-index-default-macro' will be used. For a more |
| 166 | ;; complex entry type `C-c <' (`reftex-index'), select any of | 166 | ;; complex entry type `C-c <' (`reftex-index'), select any of |
| 167 | ;; the index macros and enter the arguments with completion. | 167 | ;; the index macros and enter the arguments with completion. |
| 168 | ;; | 168 | ;; |
| 169 | ;; * The Index Phrases File (Delayed Indexing) | 169 | ;; * The Index Phrases File (Delayed Indexing) |
| 170 | ;; Type `C-c \' (`reftex-index-phrase-selection-or-word') to add | 170 | ;; Type `C-c \' (`reftex-index-phrase-selection-or-word') to add |
| 171 | ;; the current word or selection to a special _index phrase | 171 | ;; the current word or selection to a special _index phrase |
| 172 | ;; file_. RefTeX can later search the document for occurrences | 172 | ;; file_. RefTeX can later search the document for occurrences |
| 173 | ;; of these phrases and let you interactively index the matches. | 173 | ;; of these phrases and let you interactively index the matches. |
| 174 | ;; | 174 | ;; |
| 175 | ;; * Displaying and Editing the Index | 175 | ;; * Displaying and Editing the Index |
| 176 | ;; To display the compiled index in a special buffer, type `C-c | 176 | ;; To display the compiled index in a special buffer, type `C-c |
| 177 | ;; >' (`reftex-display-index'). From that buffer you can check | 177 | ;; >' (`reftex-display-index'). From that buffer you can check |
| 178 | ;; and edit all entries. | 178 | ;; and edit all entries. |
| 179 | ;; | 179 | ;; |
| 180 | ;; 5. Viewing Cross-References | 180 | ;; 5. Viewing Cross-References |
| 181 | ;; When point is on the KEY argument of a cross-referencing macro | 181 | ;; When point is on the KEY argument of a cross-referencing macro |
| 182 | ;; (`\label', `\ref', `\cite', `\bibitem', `\index', and variations) | 182 | ;; (`\label', `\ref', `\cite', `\bibitem', `\index', and variations) |
| @@ -186,14 +186,14 @@ | |||
| 186 | ;; When the enclosing macro is `\cite' or `\ref' and no other message | 186 | ;; When the enclosing macro is `\cite' or `\ref' and no other message |
| 187 | ;; occupies the echo area, information about the citation or label | 187 | ;; occupies the echo area, information about the citation or label |
| 188 | ;; will automatically be displayed in the echo area. | 188 | ;; will automatically be displayed in the echo area. |
| 189 | ;; | 189 | ;; |
| 190 | ;; 6. Multifile Documents | 190 | ;; 6. Multifile Documents |
| 191 | ;; Multifile Documents are fully supported. The included files must | 191 | ;; Multifile Documents are fully supported. The included files must |
| 192 | ;; have a file variable `TeX-master' or `tex-main-file' pointing to | 192 | ;; have a file variable `TeX-master' or `tex-main-file' pointing to |
| 193 | ;; the master file. RefTeX provides cross-referencing information | 193 | ;; the master file. RefTeX provides cross-referencing information |
| 194 | ;; from all parts of the document, and across document borders | 194 | ;; from all parts of the document, and across document borders |
| 195 | ;; (`xr.sty'). | 195 | ;; (`xr.sty'). |
| 196 | ;; | 196 | ;; |
| 197 | ;; 7. Document Parsing | 197 | ;; 7. Document Parsing |
| 198 | ;; RefTeX needs to parse the document in order to find labels and | 198 | ;; RefTeX needs to parse the document in order to find labels and |
| 199 | ;; other information. It does it automatically once and updates its | 199 | ;; other information. It does it automatically once and updates its |
| @@ -202,23 +202,23 @@ | |||
| 202 | ;; with a raw `C-u' prefix, or press the `r' key in the label | 202 | ;; with a raw `C-u' prefix, or press the `r' key in the label |
| 203 | ;; selection buffer, the table of contents buffer, or the index | 203 | ;; selection buffer, the table of contents buffer, or the index |
| 204 | ;; buffer. | 204 | ;; buffer. |
| 205 | ;; | 205 | ;; |
| 206 | ;; 8. AUCTeX | 206 | ;; 8. AUCTeX |
| 207 | ;; If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it | 207 | ;; If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it |
| 208 | ;; (see variable `reftex-plug-into-AUCTeX'). AUCTeX contains style | 208 | ;; (see variable `reftex-plug-into-AUCTeX'). AUCTeX contains style |
| 209 | ;; files which trigger appropriate settings in RefTeX, so that for | 209 | ;; files which trigger appropriate settings in RefTeX, so that for |
| 210 | ;; many of the popular LaTeX packages no additional customizations | 210 | ;; many of the popular LaTeX packages no additional customizations |
| 211 | ;; will be necessary. | 211 | ;; will be necessary. |
| 212 | ;; | 212 | ;; |
| 213 | ;; 9. Useful Settings | 213 | ;; 9. Useful Settings |
| 214 | ;; To make RefTeX faster for large documents, try these: | 214 | ;; To make RefTeX faster for large documents, try these: |
| 215 | ;; (setq reftex-enable-partial-scans t) | 215 | ;; (setq reftex-enable-partial-scans t) |
| 216 | ;; (setq reftex-save-parse-info t) | 216 | ;; (setq reftex-save-parse-info t) |
| 217 | ;; (setq reftex-use-multiple-selection-buffers t) | 217 | ;; (setq reftex-use-multiple-selection-buffers t) |
| 218 | ;; | 218 | ;; |
| 219 | ;; To integrate with AUCTeX, use | 219 | ;; To integrate with AUCTeX, use |
| 220 | ;; (setq reftex-plug-into-AUCTeX t) | 220 | ;; (setq reftex-plug-into-AUCTeX t) |
| 221 | ;; | 221 | ;; |
| 222 | ;; To make your own LaTeX macro definitions known to RefTeX, | 222 | ;; To make your own LaTeX macro definitions known to RefTeX, |
| 223 | ;; customize the variables | 223 | ;; customize the variables |
| 224 | ;; `reftex-label-alist' (for label macros/environments) | 224 | ;; `reftex-label-alist' (for label macros/environments) |
| @@ -228,7 +228,7 @@ | |||
| 228 | ;; `reftex-index-default-macro' (to set the default macro) | 228 | ;; `reftex-index-default-macro' (to set the default macro) |
| 229 | ;; If you have a large number of macros defined, you may want to write | 229 | ;; If you have a large number of macros defined, you may want to write |
| 230 | ;; an AUCTeX style file to support them with both AUCTeX and RefTeX. | 230 | ;; an AUCTeX style file to support them with both AUCTeX and RefTeX. |
| 231 | ;; | 231 | ;; |
| 232 | ;; 10. Where Next? | 232 | ;; 10. Where Next? |
| 233 | ;; Go ahead and use RefTeX. Use its menus until you have picked up | 233 | ;; Go ahead and use RefTeX. Use its menus until you have picked up |
| 234 | ;; the key bindings. For an overview of what you can do in each of | 234 | ;; the key bindings. For an overview of what you can do in each of |
| @@ -237,7 +237,7 @@ | |||
| 237 | ;; The first part of the manual explains in a tutorial way how to use | 237 | ;; The first part of the manual explains in a tutorial way how to use |
| 238 | ;; and customize RefTeX. The second part is a command and variable | 238 | ;; and customize RefTeX. The second part is a command and variable |
| 239 | ;; reference. | 239 | ;; reference. |
| 240 | ;; | 240 | ;; |
| 241 | ;;--------------------------------------------------------------------------- | 241 | ;;--------------------------------------------------------------------------- |
| 242 | ;; | 242 | ;; |
| 243 | ;; AUTHOR | 243 | ;; AUTHOR |
| @@ -319,7 +319,7 @@ | |||
| 319 | (setq reftex-syntax-table (copy-syntax-table)) | 319 | (setq reftex-syntax-table (copy-syntax-table)) |
| 320 | (modify-syntax-entry ?\( "." reftex-syntax-table) | 320 | (modify-syntax-entry ?\( "." reftex-syntax-table) |
| 321 | (modify-syntax-entry ?\) "." reftex-syntax-table)) | 321 | (modify-syntax-entry ?\) "." reftex-syntax-table)) |
| 322 | 322 | ||
| 323 | (unless reftex-syntax-table-for-bib | 323 | (unless reftex-syntax-table-for-bib |
| 324 | (setq reftex-syntax-table-for-bib | 324 | (setq reftex-syntax-table-for-bib |
| 325 | (copy-syntax-table reftex-syntax-table)) | 325 | (copy-syntax-table reftex-syntax-table)) |
| @@ -395,7 +395,7 @@ on the menu bar. | |||
| 395 | (setq reftex-syntax-table (copy-syntax-table (syntax-table))) | 395 | (setq reftex-syntax-table (copy-syntax-table (syntax-table))) |
| 396 | (modify-syntax-entry ?\( "." reftex-syntax-table) | 396 | (modify-syntax-entry ?\( "." reftex-syntax-table) |
| 397 | (modify-syntax-entry ?\) "." reftex-syntax-table) | 397 | (modify-syntax-entry ?\) "." reftex-syntax-table) |
| 398 | 398 | ||
| 399 | (setq reftex-syntax-table-for-bib | 399 | (setq reftex-syntax-table-for-bib |
| 400 | (copy-syntax-table reftex-syntax-table)) | 400 | (copy-syntax-table reftex-syntax-table)) |
| 401 | (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) | 401 | (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) |
| @@ -536,7 +536,7 @@ on the menu bar. | |||
| 536 | ((master | 536 | ((master |
| 537 | (cond | 537 | (cond |
| 538 | ((fboundp 'TeX-master-file) ; AUCTeX is loaded. Use its mechanism. | 538 | ((fboundp 'TeX-master-file) ; AUCTeX is loaded. Use its mechanism. |
| 539 | (condition-case nil | 539 | (condition-case nil |
| 540 | (TeX-master-file t) | 540 | (TeX-master-file t) |
| 541 | (error (buffer-file-name)))) | 541 | (error (buffer-file-name)))) |
| 542 | ((fboundp 'tex-main-file) (tex-main-file)) ; Emacs LaTeX mode | 542 | ((fboundp 'tex-main-file) (tex-main-file)) ; Emacs LaTeX mode |
| @@ -737,14 +737,14 @@ the label information is recompiled on next use." | |||
| 737 | 737 | ||
| 738 | ;; A list of all variables in the cache. | 738 | ;; A list of all variables in the cache. |
| 739 | ;; The cache is used to save the compiled versions of some variables. | 739 | ;; The cache is used to save the compiled versions of some variables. |
| 740 | (defconst reftex-cache-variables | 740 | (defconst reftex-cache-variables |
| 741 | '(reftex-memory ;; This MUST ALWAYS be the first! | 741 | '(reftex-memory ;; This MUST ALWAYS be the first! |
| 742 | 742 | ||
| 743 | ;; Outline | 743 | ;; Outline |
| 744 | reftex-section-levels-all | 744 | reftex-section-levels-all |
| 745 | 745 | ||
| 746 | ;; Labels | 746 | ;; Labels |
| 747 | reftex-env-or-mac-alist | 747 | reftex-env-or-mac-alist |
| 748 | reftex-special-env-parsers | 748 | reftex-special-env-parsers |
| 749 | reftex-macros-with-labels | 749 | reftex-macros-with-labels |
| 750 | reftex-label-mac-list | 750 | reftex-label-mac-list |
| @@ -761,7 +761,7 @@ the label information is recompiled on next use." | |||
| 761 | reftex-index-macro-alist | 761 | reftex-index-macro-alist |
| 762 | reftex-macros-with-index | 762 | reftex-macros-with-index |
| 763 | reftex-query-index-macro-prompt | 763 | reftex-query-index-macro-prompt |
| 764 | reftex-query-index-macro-help | 764 | reftex-query-index-macro-help |
| 765 | reftex-key-to-index-macro-alist | 765 | reftex-key-to-index-macro-alist |
| 766 | 766 | ||
| 767 | ;; Regular expressions | 767 | ;; Regular expressions |
| @@ -806,7 +806,7 @@ the label information is recompiled on next use." | |||
| 806 | (t (reftex-compile-variables))))) | 806 | (t (reftex-compile-variables))))) |
| 807 | 807 | ||
| 808 | (defun reftex-reset-mode () | 808 | (defun reftex-reset-mode () |
| 809 | "Reset RefTeX Mode. | 809 | "Reset RefTeX Mode. |
| 810 | This will re-compile the configuration information and remove all | 810 | This will re-compile the configuration information and remove all |
| 811 | current scanning information and the parse file to enforce a rescan | 811 | current scanning information and the parse file to enforce a rescan |
| 812 | on next use." | 812 | on next use." |
| @@ -857,12 +857,12 @@ This enforces rescanning the buffer on next use." | |||
| 857 | 857 | ||
| 858 | (defun reftex-erase-all-selection-and-index-buffers () | 858 | (defun reftex-erase-all-selection-and-index-buffers () |
| 859 | ;; Remove all selection buffers associated with current document. | 859 | ;; Remove all selection buffers associated with current document. |
| 860 | (mapcar | 860 | (mapcar |
| 861 | (lambda (type) | 861 | (lambda (type) |
| 862 | (reftex-erase-buffer (reftex-make-selection-buffer-name type))) | 862 | (reftex-erase-buffer (reftex-make-selection-buffer-name type))) |
| 863 | reftex-typekey-list) | 863 | reftex-typekey-list) |
| 864 | ;; Kill all index buffers | 864 | ;; Kill all index buffers |
| 865 | (mapcar | 865 | (mapcar |
| 866 | (lambda (tag) | 866 | (lambda (tag) |
| 867 | (reftex-kill-buffer (reftex-make-index-buffer-name tag))) | 867 | (reftex-kill-buffer (reftex-make-index-buffer-name tag))) |
| 868 | (cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol))))) | 868 | (cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol))))) |
| @@ -878,7 +878,7 @@ This enforces rescanning the buffer on next use." | |||
| 878 | 878 | ||
| 879 | ;; Record that we have done this, and what we have used. | 879 | ;; Record that we have done this, and what we have used. |
| 880 | (setq reftex-tables-dirty nil) | 880 | (setq reftex-tables-dirty nil) |
| 881 | (setq reftex-memory | 881 | (setq reftex-memory |
| 882 | (list reftex-label-alist | 882 | (list reftex-label-alist |
| 883 | (get reftex-docstruct-symbol 'reftex-section-levels) | 883 | (get reftex-docstruct-symbol 'reftex-section-levels) |
| 884 | (get reftex-docstruct-symbol 'reftex-label-alist-style) | 884 | (get reftex-docstruct-symbol 'reftex-label-alist-style) |
| @@ -897,7 +897,7 @@ This enforces rescanning the buffer on next use." | |||
| 897 | '(nil))) | 897 | '(nil))) |
| 898 | (all-index (reftex-uniquify-by-car | 898 | (all-index (reftex-uniquify-by-car |
| 899 | (reftex-splice-symbols-into-list | 899 | (reftex-splice-symbols-into-list |
| 900 | (append reftex-index-macros | 900 | (append reftex-index-macros |
| 901 | (get reftex-docstruct-symbol | 901 | (get reftex-docstruct-symbol |
| 902 | 'reftex-index-macros-style) | 902 | 'reftex-index-macros-style) |
| 903 | '(default)) | 903 | '(default)) |
| @@ -908,7 +908,7 @@ This enforces rescanning the buffer on next use." | |||
| 908 | macro verify repeat nindex tag key toc-level toc-levels) | 908 | macro verify repeat nindex tag key toc-level toc-levels) |
| 909 | 909 | ||
| 910 | (setq reftex-words-to-typekey-alist nil | 910 | (setq reftex-words-to-typekey-alist nil |
| 911 | reftex-prefix-to-typekey-alist | 911 | reftex-prefix-to-typekey-alist |
| 912 | '(("sec:" . "s") ("cha:" . "s") ("chap:" . "s")) | 912 | '(("sec:" . "s") ("cha:" . "s") ("chap:" . "s")) |
| 913 | reftex-typekey-list nil | 913 | reftex-typekey-list nil |
| 914 | reftex-typekey-to-format-alist nil | 914 | reftex-typekey-to-format-alist nil |
| @@ -964,7 +964,7 @@ This enforces rescanning the buffer on next use." | |||
| 964 | ((symbolp env-or-mac) | 964 | ((symbolp env-or-mac) |
| 965 | ;; A special parser function | 965 | ;; A special parser function |
| 966 | (unless (fboundp env-or-mac) | 966 | (unless (fboundp env-or-mac) |
| 967 | (message "Warning: %s does not seem to be a valid function" | 967 | (message "Warning: %s does not seem to be a valid function" |
| 968 | env-or-mac)) | 968 | env-or-mac)) |
| 969 | (setq nargs nil nlabel nil opt-args nil) | 969 | (setq nargs nil nlabel nil opt-args nil) |
| 970 | (add-to-list 'reftex-special-env-parsers env-or-mac) | 970 | (add-to-list 'reftex-special-env-parsers env-or-mac) |
| @@ -992,8 +992,8 @@ This enforces rescanning the buffer on next use." | |||
| 992 | (push (cons string toc-level) toc-levels)))))))) | 992 | (push (cons string toc-level) toc-levels)))))))) |
| 993 | ;; Translate some special context cases | 993 | ;; Translate some special context cases |
| 994 | (when (assq context reftex-default-context-regexps) | 994 | (when (assq context reftex-default-context-regexps) |
| 995 | (setq context | 995 | (setq context |
| 996 | (format | 996 | (format |
| 997 | (cdr (assq context reftex-default-context-regexps)) | 997 | (cdr (assq context reftex-default-context-regexps)) |
| 998 | (regexp-quote env-or-mac)))) | 998 | (regexp-quote env-or-mac)))) |
| 999 | ;; See if this is the first format for this typekey | 999 | ;; See if this is the first format for this typekey |
| @@ -1026,7 +1026,7 @@ This enforces rescanning the buffer on next use." | |||
| 1026 | (nreverse reftex-typekey-to-prefix-alist)) | 1026 | (nreverse reftex-typekey-to-prefix-alist)) |
| 1027 | 1027 | ||
| 1028 | ;; Prepare the typekey query prompt and help string. | 1028 | ;; Prepare the typekey query prompt and help string. |
| 1029 | (setq qh-list | 1029 | (setq qh-list |
| 1030 | (sort qh-list | 1030 | (sort qh-list |
| 1031 | (lambda (x1 x2) | 1031 | (lambda (x1 x2) |
| 1032 | (string< (downcase (car x1)) (downcase (car x2)))))) | 1032 | (string< (downcase (car x1)) (downcase (car x2)))))) |
| @@ -1037,7 +1037,7 @@ This enforces rescanning the buffer on next use." | |||
| 1037 | "]")) | 1037 | "]")) |
| 1038 | ;; In the help string, we need to wrap lines... | 1038 | ;; In the help string, we need to wrap lines... |
| 1039 | (setq reftex-type-query-help | 1039 | (setq reftex-type-query-help |
| 1040 | (concat | 1040 | (concat |
| 1041 | "SELECT A LABEL TYPE:\n--------------------\n" | 1041 | "SELECT A LABEL TYPE:\n--------------------\n" |
| 1042 | (mapconcat | 1042 | (mapconcat |
| 1043 | (lambda(x) | 1043 | (lambda(x) |
| @@ -1057,7 +1057,7 @@ This enforces rescanning the buffer on next use." | |||
| 1057 | ;; which allow for some chars from the ref format to be in the buffer. | 1057 | ;; which allow for some chars from the ref format to be in the buffer. |
| 1058 | ;; These characters will be seen and removed. | 1058 | ;; These characters will be seen and removed. |
| 1059 | (setq reftex-words-to-typekey-alist | 1059 | (setq reftex-words-to-typekey-alist |
| 1060 | (mapcar | 1060 | (mapcar |
| 1061 | (lambda (x) | 1061 | (lambda (x) |
| 1062 | (setq word (car x) | 1062 | (setq word (car x) |
| 1063 | typekey (cdr x) | 1063 | typekey (cdr x) |
| @@ -1110,18 +1110,18 @@ This enforces rescanning the buffer on next use." | |||
| 1110 | (setq reftex-key-to-index-macro-alist | 1110 | (setq reftex-key-to-index-macro-alist |
| 1111 | (sort reftex-key-to-index-macro-alist | 1111 | (sort reftex-key-to-index-macro-alist |
| 1112 | (lambda (a b) (< (downcase (car a)) (downcase (car b)))))) | 1112 | (lambda (a b) (< (downcase (car a)) (downcase (car b)))))) |
| 1113 | (setq reftex-query-index-macro-prompt | 1113 | (setq reftex-query-index-macro-prompt |
| 1114 | (concat "Index macro: [" | 1114 | (concat "Index macro: [" |
| 1115 | (mapconcat (lambda (x) (char-to-string (car x))) | 1115 | (mapconcat (lambda (x) (char-to-string (car x))) |
| 1116 | reftex-key-to-index-macro-alist "") | 1116 | reftex-key-to-index-macro-alist "") |
| 1117 | "]")) | 1117 | "]")) |
| 1118 | (setq i 0 | 1118 | (setq i 0 |
| 1119 | reftex-query-index-macro-help | 1119 | reftex-query-index-macro-help |
| 1120 | (concat | 1120 | (concat |
| 1121 | "SELECT A MACRO:\n---------------\n" | 1121 | "SELECT A MACRO:\n---------------\n" |
| 1122 | (mapconcat | 1122 | (mapconcat |
| 1123 | (lambda(x) | 1123 | (lambda(x) |
| 1124 | (format "[%c] %-20.20s%s" (car x) (nth 1 x) | 1124 | (format "[%c] %-20.20s%s" (car x) (nth 1 x) |
| 1125 | (if (= 0 (mod (incf i) 3)) "\n" ""))) | 1125 | (if (= 0 (mod (incf i) 3)) "\n" ""))) |
| 1126 | reftex-key-to-index-macro-alist ""))) | 1126 | reftex-key-to-index-macro-alist ""))) |
| 1127 | 1127 | ||
| @@ -1135,11 +1135,11 @@ This enforces rescanning the buffer on next use." | |||
| 1135 | (let* ( | 1135 | (let* ( |
| 1136 | ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") | 1136 | ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") |
| 1137 | (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because | 1137 | (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because |
| 1138 | ;;; because match number are hard coded | 1138 | ;;; because match number are hard coded |
| 1139 | (label-re "\\\\label{\\([^}]*\\)}") | 1139 | (label-re "\\\\label{\\([^}]*\\)}") |
| 1140 | (include-re (concat wbol | 1140 | (include-re (concat wbol |
| 1141 | "\\\\\\(" | 1141 | "\\\\\\(" |
| 1142 | (mapconcat 'identity | 1142 | (mapconcat 'identity |
| 1143 | reftex-include-file-commands "\\|") | 1143 | reftex-include-file-commands "\\|") |
| 1144 | "\\)[{ \t]+\\([^} \t\n\r]+\\)")) | 1144 | "\\)[{ \t]+\\([^} \t\n\r]+\\)")) |
| 1145 | (section-re | 1145 | (section-re |
| @@ -1193,7 +1193,7 @@ This enforces rescanning the buffer on next use." | |||
| 1193 | reftex-macros-with-labels macros-with-labels | 1193 | reftex-macros-with-labels macros-with-labels |
| 1194 | reftex-find-index-entry-regexp-format find-index-re-format | 1194 | reftex-find-index-entry-regexp-format find-index-re-format |
| 1195 | reftex-find-label-regexp-format find-label-re-format | 1195 | reftex-find-label-regexp-format find-label-re-format |
| 1196 | reftex-find-label-regexp-format2 | 1196 | reftex-find-label-regexp-format2 |
| 1197 | "\\([]} \t\n\r]\\)\\([[{]\\)\\(%s\\)[]}]") | 1197 | "\\([]} \t\n\r]\\)\\([[{]\\)\\(%s\\)[]}]") |
| 1198 | (message "Compiling label environment definitions...done"))) | 1198 | (message "Compiling label environment definitions...done"))) |
| 1199 | (put reftex-docstruct-symbol 'reftex-cache | 1199 | (put reftex-docstruct-symbol 'reftex-cache |
| @@ -1232,7 +1232,7 @@ This enforces rescanning the buffer on next use." | |||
| 1232 | ;; Error out in a buffer without a file. | 1232 | ;; Error out in a buffer without a file. |
| 1233 | (if (and reftex-mode | 1233 | (if (and reftex-mode |
| 1234 | (not (buffer-file-name))) | 1234 | (not (buffer-file-name))) |
| 1235 | (error "RefTeX works only in buffers visiting a file.")) | 1235 | (error "RefTeX works only in buffers visiting a file")) |
| 1236 | 1236 | ||
| 1237 | ;; Make sure we have the symbols tied | 1237 | ;; Make sure we have the symbols tied |
| 1238 | (if (eq reftex-docstruct-symbol nil) | 1238 | (if (eq reftex-docstruct-symbol nil) |
| @@ -1270,7 +1270,7 @@ This enforces rescanning the buffer on next use." | |||
| 1270 | (and (symbolp reftex-docstruct-symbol) | 1270 | (and (symbolp reftex-docstruct-symbol) |
| 1271 | (symbol-value reftex-docstruct-symbol) | 1271 | (symbol-value reftex-docstruct-symbol) |
| 1272 | t)) | 1272 | t)) |
| 1273 | 1273 | ||
| 1274 | (defun reftex-silence-toc-markers (list n) | 1274 | (defun reftex-silence-toc-markers (list n) |
| 1275 | ;; Set all toc markers in the first N entries in list to nil | 1275 | ;; Set all toc markers in the first N entries in list to nil |
| 1276 | (while (and list (> (decf n) -1)) | 1276 | (while (and list (> (decf n) -1)) |
| @@ -1287,7 +1287,7 @@ Valid actions are: readable, restore, read, kill, write." | |||
| 1287 | (master (reftex-TeX-master-file)) | 1287 | (master (reftex-TeX-master-file)) |
| 1288 | (enable-local-variables nil) | 1288 | (enable-local-variables nil) |
| 1289 | (file (if (string-match "\\.[a-zA-Z]+\\'" master) | 1289 | (file (if (string-match "\\.[a-zA-Z]+\\'" master) |
| 1290 | (concat (substring master 0 (match-beginning 0)) | 1290 | (concat (substring master 0 (match-beginning 0)) |
| 1291 | reftex-parse-file-extension) | 1291 | reftex-parse-file-extension) |
| 1292 | (concat master reftex-parse-file-extension)))) | 1292 | (concat master reftex-parse-file-extension)))) |
| 1293 | (cond | 1293 | (cond |
| @@ -1366,7 +1366,7 @@ Valid actions are: readable, restore, read, kill, write." | |||
| 1366 | 1366 | ||
| 1367 | ;; Check if the master is the same: when moving a document, this will see it. | 1367 | ;; Check if the master is the same: when moving a document, this will see it. |
| 1368 | (let* ((real-master (reftex-TeX-master-file)) | 1368 | (let* ((real-master (reftex-TeX-master-file)) |
| 1369 | (parsed-master | 1369 | (parsed-master |
| 1370 | (nth 1 (assq 'bof (symbol-value reftex-docstruct-symbol))))) | 1370 | (nth 1 (assq 'bof (symbol-value reftex-docstruct-symbol))))) |
| 1371 | (unless (string= (file-truename real-master) (file-truename parsed-master)) | 1371 | (unless (string= (file-truename real-master) (file-truename parsed-master)) |
| 1372 | (message "Master file name in load file is different: %s versus %s" | 1372 | (message "Master file name in load file is different: %s versus %s" |
| @@ -1386,7 +1386,7 @@ Valid actions are: readable, restore, read, kill, write." | |||
| 1386 | (defun reftex-select-external-document (xr-alist xr-index) | 1386 | (defun reftex-select-external-document (xr-alist xr-index) |
| 1387 | ;; Return index of an external document. | 1387 | ;; Return index of an external document. |
| 1388 | (let* ((len (length xr-alist)) (highest (1- (+ ?0 len))) | 1388 | (let* ((len (length xr-alist)) (highest (1- (+ ?0 len))) |
| 1389 | (prompt (format "[%c-%c] Select TAB: Read prefix with completion" | 1389 | (prompt (format "[%c-%c] Select TAB: Read prefix with completion" |
| 1390 | ?0 highest)) | 1390 | ?0 highest)) |
| 1391 | key prefix) | 1391 | key prefix) |
| 1392 | (cond | 1392 | (cond |
| @@ -1397,7 +1397,7 @@ Valid actions are: readable, restore, read, kill, write." | |||
| 1397 | (- 1 xr-index)) | 1397 | (- 1 xr-index)) |
| 1398 | (t | 1398 | (t |
| 1399 | (save-excursion | 1399 | (save-excursion |
| 1400 | (let* ((length (apply 'max (mapcar | 1400 | (let* ((length (apply 'max (mapcar |
| 1401 | (lambda(x) (length (car x))) xr-alist))) | 1401 | (lambda(x) (length (car x))) xr-alist))) |
| 1402 | (fmt (format " [%%c] %%-%ds %%s\n" length)) | 1402 | (fmt (format " [%%c] %%-%ds %%s\n" length)) |
| 1403 | (n (1- ?0))) | 1403 | (n (1- ?0))) |
| @@ -1407,7 +1407,7 @@ Valid actions are: readable, restore, read, kill, write." | |||
| 1407 | (concat | 1407 | (concat |
| 1408 | "SELECT EXTERNAL DOCUMENT\n------------------------\n" | 1408 | "SELECT EXTERNAL DOCUMENT\n------------------------\n" |
| 1409 | (mapconcat | 1409 | (mapconcat |
| 1410 | (lambda (x) | 1410 | (lambda (x) |
| 1411 | (format fmt (incf n) (or (car x) "") | 1411 | (format fmt (incf n) (or (car x) "") |
| 1412 | (abbreviate-file-name (cdr x)))) | 1412 | (abbreviate-file-name (cdr x)))) |
| 1413 | xr-alist "")) | 1413 | xr-alist "")) |
| @@ -1431,7 +1431,7 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1431 | (let* ((rec-values (if reftex-search-unrecursed-path-first '(nil t) '(t))) | 1431 | (let* ((rec-values (if reftex-search-unrecursed-path-first '(nil t) '(t))) |
| 1432 | (extensions (cdr (assoc type reftex-file-extensions))) | 1432 | (extensions (cdr (assoc type reftex-file-extensions))) |
| 1433 | (def-ext (car extensions)) | 1433 | (def-ext (car extensions)) |
| 1434 | (ext-re (concat "\\(" | 1434 | (ext-re (concat "\\(" |
| 1435 | (mapconcat 'regexp-quote extensions "\\|") | 1435 | (mapconcat 'regexp-quote extensions "\\|") |
| 1436 | "\\)\\'")) | 1436 | "\\)\\'")) |
| 1437 | (files (if (string-match ext-re file) | 1437 | (files (if (string-match ext-re file) |
| @@ -1440,8 +1440,8 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1440 | path old-path file1) | 1440 | path old-path file1) |
| 1441 | (cond | 1441 | (cond |
| 1442 | ((file-name-absolute-p file) | 1442 | ((file-name-absolute-p file) |
| 1443 | (setq file1 | 1443 | (setq file1 |
| 1444 | (or | 1444 | (or |
| 1445 | (and (car files) (file-regular-p (car files)) (car files)) | 1445 | (and (car files) (file-regular-p (car files)) (car files)) |
| 1446 | (and (cdr files) (file-regular-p (cdr files)) (cdr files))))) | 1446 | (and (cdr files) (file-regular-p (cdr files)) (cdr files))))) |
| 1447 | ((and reftex-use-external-file-finders | 1447 | ((and reftex-use-external-file-finders |
| @@ -1456,10 +1456,10 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1456 | (setq old-path path | 1456 | (setq old-path path |
| 1457 | path (cons master-dir path) | 1457 | path (cons master-dir path) |
| 1458 | file1 (or (and (car files) | 1458 | file1 (or (and (car files) |
| 1459 | (reftex-find-file-on-path | 1459 | (reftex-find-file-on-path |
| 1460 | (car files) path master-dir)) | 1460 | (car files) path master-dir)) |
| 1461 | (and (cdr files) | 1461 | (and (cdr files) |
| 1462 | (reftex-find-file-on-path | 1462 | (reftex-find-file-on-path |
| 1463 | (cdr files) path master-dir)))))))) | 1463 | (cdr files) path master-dir)))))))) |
| 1464 | (cond (file1 file1) | 1464 | (cond (file1 file1) |
| 1465 | (die (error "No such file: %s" file) nil) | 1465 | (die (error "No such file: %s" file) nil) |
| @@ -1504,7 +1504,7 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1504 | (reftex-uniquify | 1504 | (reftex-uniquify |
| 1505 | (reftex-parse-colon-path | 1505 | (reftex-parse-colon-path |
| 1506 | (mapconcat | 1506 | (mapconcat |
| 1507 | (lambda(x) | 1507 | (lambda(x) |
| 1508 | (if (string-match "^!" x) | 1508 | (if (string-match "^!" x) |
| 1509 | (apply 'reftex-process-string | 1509 | (apply 'reftex-process-string |
| 1510 | (split-string (substring x 1))) | 1510 | (split-string (substring x 1))) |
| @@ -1513,7 +1513,7 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1513 | ;; (cdr (assoc type reftex-path-environment)) | 1513 | ;; (cdr (assoc type reftex-path-environment)) |
| 1514 | ;; However, historically we have separate options for the | 1514 | ;; However, historically we have separate options for the |
| 1515 | ;; environment variables, so we have to do this: | 1515 | ;; environment variables, so we have to do this: |
| 1516 | (symbol-value (intern (concat "reftex-" type | 1516 | (symbol-value (intern (concat "reftex-" type |
| 1517 | "path-environment-variables"))) | 1517 | "path-environment-variables"))) |
| 1518 | path-separator)))) | 1518 | path-separator)))) |
| 1519 | (put pathvar 'status 'split) | 1519 | (put pathvar 'status 'split) |
| @@ -1539,11 +1539,11 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1539 | ;; or: Relative recursive path elements need to be expanded | 1539 | ;; or: Relative recursive path elements need to be expanded |
| 1540 | ;; relative to new default directory | 1540 | ;; relative to new default directory |
| 1541 | (message "Expanding search path to find %s file: %s ..." type file) | 1541 | (message "Expanding search path to find %s file: %s ..." type file) |
| 1542 | (put pathvar 'recursive-path | 1542 | (put pathvar 'recursive-path |
| 1543 | (reftex-expand-path (symbol-value pathvar) master-dir)) | 1543 | (reftex-expand-path (symbol-value pathvar) master-dir)) |
| 1544 | (put pathvar 'master-dir master-dir) | 1544 | (put pathvar 'master-dir master-dir) |
| 1545 | (get pathvar 'recursive-path)) | 1545 | (get pathvar 'recursive-path)) |
| 1546 | (t | 1546 | (t |
| 1547 | ;; Recursive path computed earlier is still OK. | 1547 | ;; Recursive path computed earlier is still OK. |
| 1548 | (get pathvar 'recursive-path))) | 1548 | (get pathvar 'recursive-path))) |
| 1549 | ;; The simple path was requested | 1549 | ;; The simple path was requested |
| @@ -1572,7 +1572,7 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1572 | ;; Trailing ! or !! will be converted into `//' (emTeX convention) | 1572 | ;; Trailing ! or !! will be converted into `//' (emTeX convention) |
| 1573 | (mapcar | 1573 | (mapcar |
| 1574 | (lambda (dir) | 1574 | (lambda (dir) |
| 1575 | (if (string-match "\\(//+\\|/*!+\\)\\'" dir) | 1575 | (if (string-match "\\(//+\\|/*!+\\)\\'" dir) |
| 1576 | (setq dir (replace-match "//" t t dir))) | 1576 | (setq dir (replace-match "//" t t dir))) |
| 1577 | (file-name-as-directory dir)) | 1577 | (file-name-as-directory dir)) |
| 1578 | (delete "" (split-string path (concat path-separator "+"))))) | 1578 | (delete "" (split-string path (concat path-separator "+"))))) |
| @@ -1601,7 +1601,7 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1601 | (when (file-directory-p dir) | 1601 | (when (file-directory-p dir) |
| 1602 | (setq files (nreverse (directory-files dir t "[^.]"))) | 1602 | (setq files (nreverse (directory-files dir t "[^.]"))) |
| 1603 | (while (setq file (pop files)) | 1603 | (while (setq file (pop files)) |
| 1604 | (if (file-directory-p file) | 1604 | (if (file-directory-p file) |
| 1605 | (push (file-name-as-directory file) path))) | 1605 | (push (file-name-as-directory file) path))) |
| 1606 | (push dir path1))) | 1606 | (push dir path1))) |
| 1607 | path1)) | 1607 | path1)) |
| @@ -1664,7 +1664,7 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1664 | "Show the table of contents for the current document." t) | 1664 | "Show the table of contents for the current document." t) |
| 1665 | (autoload 'reftex-toc-recenter "reftex-toc" | 1665 | (autoload 'reftex-toc-recenter "reftex-toc" |
| 1666 | "Display the TOC window and highlight line corresponding to current position." t) | 1666 | "Display the TOC window and highlight line corresponding to current position." t) |
| 1667 | (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" | 1667 | (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" |
| 1668 | "Toggle automatic recentering of TOC window." t) | 1668 | "Toggle automatic recentering of TOC window." t) |
| 1669 | 1669 | ||
| 1670 | ;;; ========================================================================= | 1670 | ;;; ========================================================================= |
| @@ -1883,7 +1883,7 @@ Works on both Emacs and XEmacs." | |||
| 1883 | (while list | 1883 | (while list |
| 1884 | (if (funcall predicate (car list)) | 1884 | (if (funcall predicate (car list)) |
| 1885 | (push (if completion | 1885 | (push (if completion |
| 1886 | (list (nth nth (car list))) | 1886 | (list (nth nth (car list))) |
| 1887 | (nth nth (car list))) | 1887 | (nth nth (car list))) |
| 1888 | rtn)) | 1888 | rtn)) |
| 1889 | (setq list (cdr list))) | 1889 | (setq list (cdr list))) |
| @@ -1919,7 +1919,7 @@ Works on both Emacs and XEmacs." | |||
| 1919 | ;; If POS is given, calculate distances relative to it. | 1919 | ;; If POS is given, calculate distances relative to it. |
| 1920 | ;; Return nil if there is no match. | 1920 | ;; Return nil if there is no match. |
| 1921 | (let ((pos (point)) | 1921 | (let ((pos (point)) |
| 1922 | (dist (or max-length (length regexp))) | 1922 | (dist (or max-length (length regexp))) |
| 1923 | match1 match2 match) | 1923 | match1 match2 match) |
| 1924 | (goto-char (min (+ pos dist) (point-max))) | 1924 | (goto-char (min (+ pos dist) (point-max))) |
| 1925 | (when (re-search-backward regexp nil t) | 1925 | (when (re-search-backward regexp nil t) |
| @@ -2005,10 +2005,10 @@ Works on both Emacs and XEmacs." | |||
| 2005 | ((and scroll (equal char ?\C-? )) | 2005 | ((and scroll (equal char ?\C-? )) |
| 2006 | (condition-case nil (scroll-down) (error nil)) | 2006 | (condition-case nil (scroll-down) (error nil)) |
| 2007 | (message prompt)) | 2007 | (message prompt)) |
| 2008 | (t (message "") | 2008 | (t (message "") |
| 2009 | (throw 'exit char))) | 2009 | (throw 'exit char))) |
| 2010 | (setq char (read-char-exclusive))))))) | 2010 | (setq char (read-char-exclusive))))))) |
| 2011 | 2011 | ||
| 2012 | 2012 | ||
| 2013 | (defun reftex-make-regexp-allow-for-ctrl-m (string) | 2013 | (defun reftex-make-regexp-allow-for-ctrl-m (string) |
| 2014 | ;; convert STRING into a regexp, allowing ^M for \n and vice versa | 2014 | ;; convert STRING into a regexp, allowing ^M for \n and vice versa |
| @@ -2206,10 +2206,10 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2206 | ;; Restrict number of words | 2206 | ;; Restrict number of words |
| 2207 | (if (> (length words) nwords) | 2207 | (if (> (length words) nwords) |
| 2208 | (setcdr (nthcdr (1- nwords) words) nil)) | 2208 | (setcdr (nthcdr (1- nwords) words) nil)) |
| 2209 | 2209 | ||
| 2210 | ;; First, try to use all words | 2210 | ;; First, try to use all words |
| 2211 | (setq string (mapconcat 'identity words sep)) | 2211 | (setq string (mapconcat 'identity words sep)) |
| 2212 | 2212 | ||
| 2213 | ;; Abbreviate words if enforced by user settings or string length | 2213 | ;; Abbreviate words if enforced by user settings or string length |
| 2214 | (if (or (eq t abbrev) | 2214 | (if (or (eq t abbrev) |
| 2215 | (and abbrev | 2215 | (and abbrev |
| @@ -2301,7 +2301,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2301 | (font-lock-set-defaults-1) | 2301 | (font-lock-set-defaults-1) |
| 2302 | (reftex-select-font-lock-fontify-region (point-min) (point-max)))) | 2302 | (reftex-select-font-lock-fontify-region (point-min) (point-max)))) |
| 2303 | (t | 2303 | (t |
| 2304 | ;; Oops? | 2304 | ;; Oops? |
| 2305 | (message "Sorry: cannot refontify RefTeX Select buffer.")))) | 2305 | (message "Sorry: cannot refontify RefTeX Select buffer.")))) |
| 2306 | (rename-buffer oldname)))) | 2306 | (rename-buffer oldname)))) |
| 2307 | 2307 | ||
| @@ -2350,7 +2350,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2350 | 2350 | ||
| 2351 | ;; Initialize the overlays | 2351 | ;; Initialize the overlays |
| 2352 | (aset reftex-highlight-overlays 0 (reftex-make-overlay 1 1)) | 2352 | (aset reftex-highlight-overlays 0 (reftex-make-overlay 1 1)) |
| 2353 | (reftex-overlay-put (aref reftex-highlight-overlays 0) | 2353 | (reftex-overlay-put (aref reftex-highlight-overlays 0) |
| 2354 | 'face 'highlight) | 2354 | 'face 'highlight) |
| 2355 | (aset reftex-highlight-overlays 1 (reftex-make-overlay 1 1)) | 2355 | (aset reftex-highlight-overlays 1 (reftex-make-overlay 1 1)) |
| 2356 | (reftex-overlay-put (aref reftex-highlight-overlays 1) | 2356 | (reftex-overlay-put (aref reftex-highlight-overlays 1) |
| @@ -2375,7 +2375,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2375 | 2375 | ||
| 2376 | ;;; ========================================================================= | 2376 | ;;; ========================================================================= |
| 2377 | ;;; | 2377 | ;;; |
| 2378 | ;;; Keybindings | 2378 | ;;; Keybindings |
| 2379 | 2379 | ||
| 2380 | ;; The default bindings in the mode map. | 2380 | ;; The default bindings in the mode map. |
| 2381 | (loop for x in | 2381 | (loop for x in |
| @@ -2395,10 +2395,10 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2395 | ;; Bind `reftex-mouse-view-crossref' only when the key is still free | 2395 | ;; Bind `reftex-mouse-view-crossref' only when the key is still free |
| 2396 | (if (featurep 'xemacs) | 2396 | (if (featurep 'xemacs) |
| 2397 | (unless (key-binding [(shift button2)]) | 2397 | (unless (key-binding [(shift button2)]) |
| 2398 | (define-key reftex-mode-map [(shift button2)] | 2398 | (define-key reftex-mode-map [(shift button2)] |
| 2399 | 'reftex-mouse-view-crossref)) | 2399 | 'reftex-mouse-view-crossref)) |
| 2400 | (unless (key-binding [(shift mouse-2)]) | 2400 | (unless (key-binding [(shift mouse-2)]) |
| 2401 | (define-key reftex-mode-map [(shift mouse-2)] | 2401 | (define-key reftex-mode-map [(shift mouse-2)] |
| 2402 | 'reftex-mouse-view-crossref))) | 2402 | 'reftex-mouse-view-crossref))) |
| 2403 | 2403 | ||
| 2404 | ;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map | 2404 | ;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map |
| @@ -2502,7 +2502,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2502 | ("Reference Style" | 2502 | ("Reference Style" |
| 2503 | ["Default" (setq reftex-vref-is-default nil | 2503 | ["Default" (setq reftex-vref-is-default nil |
| 2504 | reftex-fref-is-default nil) | 2504 | reftex-fref-is-default nil) |
| 2505 | :style radio :selected (not (or reftex-vref-is-default | 2505 | :style radio :selected (not (or reftex-vref-is-default |
| 2506 | reftex-fref-is-default))] | 2506 | reftex-fref-is-default))] |
| 2507 | ["Varioref" (setq reftex-vref-is-default t | 2507 | ["Varioref" (setq reftex-vref-is-default t |
| 2508 | reftex-fref-is-default nil) | 2508 | reftex-fref-is-default nil) |
| @@ -2537,7 +2537,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2537 | (list 'reftex-add-index-macros (list 'list (list 'quote (car x)))) | 2537 | (list 'reftex-add-index-macros (list 'list (list 'quote (car x)))) |
| 2538 | :style 'radio :selected | 2538 | :style 'radio :selected |
| 2539 | (list 'memq (list 'quote (car x)) | 2539 | (list 'memq (list 'quote (car x)) |
| 2540 | (list 'get 'reftex-docstruct-symbol | 2540 | (list 'get 'reftex-docstruct-symbol |
| 2541 | (list 'quote 'reftex-index-macros-style))))) | 2541 | (list 'quote 'reftex-index-macros-style))))) |
| 2542 | reftex-index-macros-builtin)) | 2542 | reftex-index-macros-builtin)) |
| 2543 | "--" | 2543 | "--" |
| @@ -2546,7 +2546,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2546 | ("Customize" | 2546 | ("Customize" |
| 2547 | ["Browse RefTeX Group" reftex-customize t] | 2547 | ["Browse RefTeX Group" reftex-customize t] |
| 2548 | "--" | 2548 | "--" |
| 2549 | ["Build Full Customize Menu" reftex-create-customize-menu | 2549 | ["Build Full Customize Menu" reftex-create-customize-menu |
| 2550 | (fboundp 'customize-menu-create)]) | 2550 | (fboundp 'customize-menu-create)]) |
| 2551 | ("Documentation" | 2551 | ("Documentation" |
| 2552 | ["Info" reftex-info t] | 2552 | ["Info" reftex-info t] |
| @@ -2562,7 +2562,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2562 | (interactive) | 2562 | (interactive) |
| 2563 | (if (fboundp 'customize-menu-create) | 2563 | (if (fboundp 'customize-menu-create) |
| 2564 | (progn | 2564 | (progn |
| 2565 | (easy-menu-change | 2565 | (easy-menu-change |
| 2566 | '("Ref") "Customize" | 2566 | '("Ref") "Customize" |
| 2567 | `(["Browse RefTeX group" reftex-customize t] | 2567 | `(["Browse RefTeX group" reftex-customize t] |
| 2568 | "--" | 2568 | "--" |
| @@ -2600,7 +2600,7 @@ With optional NODE, go directly to that node." | |||
| 2600 | ;;; That's it! ---------------------------------------------------------------- | 2600 | ;;; That's it! ---------------------------------------------------------------- |
| 2601 | 2601 | ||
| 2602 | (setq reftex-tables-dirty t) ; in case this file is evaluated by hand | 2602 | (setq reftex-tables-dirty t) ; in case this file is evaluated by hand |
| 2603 | (provide 'reftex) | 2603 | (provide 'reftex) |
| 2604 | 2604 | ||
| 2605 | ;;;============================================================================ | 2605 | ;;;============================================================================ |
| 2606 | 2606 | ||