Mercurial > emacs
comparison lisp/textmodes/reftex-vars.el @ 26910:489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
`reftex-index-macro'
(reftex-compile-variables): Use the changed structure of
`reftex-label-alist'.
* reftex-vars.el (reftex-index-math-format,
(reftex-toc-max-level): New option.
reftex-index-phrases-search-whole-words,
reftex-index-phrases-case-fold-search,
reftex-index-phrases-skip-indexed-matches,
reftex-index-phrases-wrap-long-lines,
reftex-index-phrases-sort-prefers-entry,
reftex-index-phrases-sort-in-blocks): New options.
(reftex-index-macros): Option structure changed.
(reftex-index-macros-builtin): Added `repeat' item to each entry.
(reftex-label-alist): Additional item in each entry to specify if
the environment should be listed in the TOC.
(eval-when-compile (require 'cl)) added.
* reftex-index.el (reftex-index-selection-or-word): No longer
deals with "repeat".
(reftex-index): "repeat property in `reftex-index-macro-alist' is
now used.
(reftex-index-phrases-comment-regexp,
reftex-index-phrases-macrodef-regexp,
reftex-index-phrases-phrase-regexp1,
reftex-index-phrases-phrase-regexp2,
reftex-index-phrases-phrase-regexp12, reftex-index-phrases-help):
New constants.
(reftex-index-phrases-macro-data, reftex-index-phrases-files,
reftex-index-phrases-font-lock-keywords,
reftex-index-phrases-font-lock-defaults, reftex-index-phrases-map,
reftex-index-phrases-restrict-file): New variables.
(reftex-index-phrase-selection-or-word,
reftex-index-visit-phrases-buffer,
reftex-index-initialize-phrases-buffer,
reftex-index-phrases-save-and-return, reftex-index-phrases-mode,
reftex-index-next-phrase, reftex-index-this-phrase,
reftex-index-all-phrases, reftex-index-region-phrases,
reftex-index-phrases-parse-header,
reftex-index-phrases-toggle-restricted, reftex-index-new-phrase,
reftex-index-find-next-conflict-phrase, reftex-index-phrases-info,
reftex-index-phrases-set-macro-key, reftex-index-sort-phrases,
reftex-compare-phrase-lines, reftex-index-make-phrase-regexp,
reftex-index-simplify-phrase, reftex-index-phrases-find-dup-re,
reftex-index-make-replace-string,
reftex-query-index-phrase-globally, reftex-query-index-phrase,
reftex-index-phrase-match-is-indexed,
reftex-index-phrases-fixup-line,
reftex-index-phrases-replace-space,
reftex-index-select-phrases-macro): New functions.
(reftex-index-globalize, reftex-index-globally): functions removed
(eval-when-compile (require 'cl)) added.
* reftex-toc.el (reftex-toc-mode): Create new indicator for max
level.
(reftex-toc-max-level-indicator): New variable.
(reftex-toc-max-level): New command.
(reftex-toc-map): New keybinding `t'.
(reftex-toc-help): Constant updated.
(eval-when-compile (require 'cl)) added.
* reftex-ref.el (reftex-offer-label-menu): Prefix to `t' command key
can change `reftex-toc-max-level'
(eval-when-compile (require 'cl)) added.
* reftex-sel (reftex-insert-docstruct): Respect
`reftex-toc-max-level'
(eval-when-compile (require 'cl)) added.
* reftex-auc.el (eval-when-compile (require 'cl)) added.
* reftex-vcr.el (eval-when-compile (require 'cl)) added.
* reftex-cite.el (reftex-citep, reftex-citet): New commands.
(reftex-citation, reftex-do-citation,
reftex-figure-out-cite-format): Additional argument FORMAT-KEY to
preselect a citation format.
(eval-when-compile (require 'cl)) added.
* reftex-parse.el (reftex-context-substring): Optional parameter
to-end
(reftex-section-info): Deal with environment matches.
(eval-when-compile (require 'cl)) added.
* reftex-global.el (eval-when-compile (require 'cl)) added.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Wed, 15 Dec 1999 17:02:38 +0000 |
parents | 8ae20ae6b8d2 |
children | 083669ed376a |
comparison
equal
deleted
inserted
replaced
26909:5a2ef05e2490 | 26910:489a5439b988 |
---|---|
1 ;;; reftex-vars.el - Configuration variables for RefTeX | 1 ;;; reftex-vars.el - Configuration variables for RefTeX |
2 ;;; Version: 4.6 | 2 ;;; Version: 4.9 |
3 ;;; | 3 ;;; |
4 ;;; See main file reftex.el for licensing information | 4 ;;; See main file reftex.el for licensing information |
5 | 5 |
6 (eval-when-compile (require 'cl)) | |
6 (provide 'reftex-vars) | 7 (provide 'reftex-vars) |
7 | 8 |
8 ;; Define the two constants which are needed during compilation | 9 ;; Define the two constants which are needed during compilation |
9 | 10 |
10 (eval-and-compile | 11 (eval-and-compile |
149 `?t' should point to a textual citation (citation as a noun). | 150 `?t' should point to a textual citation (citation as a noun). |
150 `?p' should point to a parenthetical citation.") | 151 `?p' should point to a parenthetical citation.") |
151 | 152 |
152 (defconst reftex-index-macros-builtin | 153 (defconst reftex-index-macros-builtin |
153 '((default "Default \\index and \\glossary macros" | 154 '((default "Default \\index and \\glossary macros" |
154 (("\\index{*}" "idx" ?i "" nil) | 155 (("\\index{*}" "idx" ?i "" nil t) |
155 ("\\glossary{*}" "glo" ?g "" nil))) | 156 ("\\glossary{*}" "glo" ?g "" nil t))) |
156 (multind "The multind.sty package" | 157 (multind "The multind.sty package" |
157 (("\\index{}{*}" 1 ?i "" nil))) | 158 (("\\index{}{*}" 1 ?i "" nil t))) |
158 (index "The index.sty package" | 159 (index "The index.sty package" |
159 (("\\index[]{*}" 1 ?i "" nil) | 160 (("\\index[]{*}" 1 ?i "" nil t) |
160 ("\\index*[]{*}" 1 ?I "" nil))) | 161 ("\\index*[]{*}" 1 ?I "" nil nil))) |
161 (Index-Shortcut "index.sty with \\shortindexingon" | 162 (Index-Shortcut "index.sty with \\shortindexingon" |
162 (("\\index[]{*}" 1 ?i "" nil) | 163 (("\\index[]{*}" 1 ?i "" nil t) |
163 ("\\index*[]{*}" 1 ?I "" nil) | 164 ("\\index*[]{*}" 1 ?I "" nil nil) |
164 ("^[]{*}" 1 ?^ "" texmathp) | 165 ("^[]{*}" 1 ?^ "" texmathp t) |
165 ("_[]{*}" 1 ?_ "" texmathp)))) | 166 ("_[]{*}" 1 ?_ "" texmathp nil)))) |
166 "Builtin stuff for reftex-index-macros. | 167 "Builtin stuff for reftex-index-macros. |
167 Lower-case symbols correspond to a style file of the same name in the LaTeX | 168 Lower-case symbols correspond to a style file of the same name in the LaTeX |
168 distribution. Mixed-case symbols are convenience aliases.") | 169 distribution. Mixed-case symbols are convenience aliases.") |
169 ) | 170 ) |
170 | 171 |
183 ;; Table of contents configuration -------------------------------------- | 184 ;; Table of contents configuration -------------------------------------- |
184 | 185 |
185 (defgroup reftex-table-of-contents-browser nil | 186 (defgroup reftex-table-of-contents-browser nil |
186 "A multifile table of contents browser." | 187 "A multifile table of contents browser." |
187 :group 'reftex) | 188 :group 'reftex) |
189 | |
190 (defcustom reftex-toc-max-level 100 | |
191 "*The maximum level of toc entries which will be included in the TOC. | |
192 Section headings with a bigger level will be ignored. In RefTeX, chapters | |
193 are level 1, sections are level 2 etc. | |
194 This variable can be changed from within the *toc* buffer with the `t' key." | |
195 :group 'reftex-table-of-contents-browser | |
196 :type 'integer) | |
188 | 197 |
189 (defcustom reftex-toc-keep-other-windows t | 198 (defcustom reftex-toc-keep-other-windows t |
190 "*Non-nil means, split the selected window to display the *toc* buffer. | 199 "*Non-nil means, split the selected window to display the *toc* buffer. |
191 This helps to keep the window configuration, but makes the *toc* small. | 200 This helps to keep the window configuration, but makes the *toc* small. |
192 When nil, all other windows except the selected one will be deleted, so | 201 When nil, all other windows except the selected one will be deleted, so |
282 | 291 |
283 The value of the variable must be a list of items. Each item is a list | 292 The value of the variable must be a list of items. Each item is a list |
284 itself and has the following structure: | 293 itself and has the following structure: |
285 | 294 |
286 (ENV-OR-MACRO TYPE-KEY LABEL-PREFIX REFERENCE-FORMAT CONTEXT-METHOD | 295 (ENV-OR-MACRO TYPE-KEY LABEL-PREFIX REFERENCE-FORMAT CONTEXT-METHOD |
287 (MAGIC-WORD ... )) | 296 (MAGIC-WORD ... ) TOC-LEVEL) |
288 | 297 |
289 Each list entry describes either an environment carrying a counter for use | 298 Each list entry describes either an environment carrying a counter for use |
290 with \\label and \\ref, or a LaTeX macro defining a label as (or inside) | 299 with \\label and \\ref, or a LaTeX macro defining a label as (or inside) |
291 one of its arguments. The elements of each list entry are: | 300 one of its arguments. The elements of each list entry are: |
292 | 301 |
382 `reftex-reference', the label list offered will be automatically | 391 `reftex-reference', the label list offered will be automatically |
383 restricted to labels of the correct type. | 392 restricted to labels of the correct type. |
384 If the first element of this wordlist is the symbol `regexp', the | 393 If the first element of this wordlist is the symbol `regexp', the |
385 strings are interpreted as regular expressions. RefTeX will add | 394 strings are interpreted as regular expressions. RefTeX will add |
386 a \"\\\\W\" to the beginning and other stuff to the end of the regexp. | 395 a \"\\\\W\" to the beginning and other stuff to the end of the regexp. |
396 | |
397 TOC-LEVEL | |
398 The integer level at which this environment should be added to the | |
399 table of contents. See also `reftex-section-levels'. A positive | |
400 value will number the entries mixed with the sectioning commands of | |
401 the same level. A negative value will make unnumbered entries. | |
402 Useful only for theorem-like environments, will be ignored for macros. | |
403 When omitted or nil, no TOC entries will be made. | |
387 | 404 |
388 If the type indicator characters of two or more entries are the same, RefTeX | 405 If the type indicator characters of two or more entries are the same, RefTeX |
389 will use | 406 will use |
390 - the first non-nil format and prefix | 407 - the first non-nil format and prefix |
391 - the magic words of all involved entries. | 408 - the magic words of all involved entries. |
423 (const :tag "Caption in float" caption) | 440 (const :tag "Caption in float" caption) |
424 (const :tag "Item in list" item) | 441 (const :tag "Item in list" item) |
425 (const :tag "Eqnarray-like" eqnarray-like) | 442 (const :tag "Eqnarray-like" eqnarray-like) |
426 (const :tag "Alignat-like" alignat-like) | 443 (const :tag "Alignat-like" alignat-like) |
427 (symbol :tag "Function" my-func)) | 444 (symbol :tag "Function" my-func)) |
428 (repeat :tag "Magic words" :extra-offset 2 (string))) | 445 (repeat :tag "Magic words" :extra-offset 2 (string)) |
446 (option (choice :tag "Make TOC entry " | |
447 (const :tag "No entry" nil) | |
448 (integer :tag "Level" :value -3)))) | |
429 (choice | 449 (choice |
430 :tag "Package" | 450 :tag "Package" |
431 :value AMSTeX | 451 :value AMSTeX |
432 ,@(mapcar | 452 ,@(mapcar |
433 (lambda (x) | 453 (lambda (x) |
980 (string :tag "ESCAPE char "))) | 1000 (string :tag "ESCAPE char "))) |
981 | 1001 |
982 (defcustom reftex-index-macros nil | 1002 (defcustom reftex-index-macros nil |
983 "Macros which define index entries. The structure is | 1003 "Macros which define index entries. The structure is |
984 | 1004 |
985 (MACRO INDEX-TAG KEY PREFIX EXCLUDE) | 1005 (MACRO INDEX-TAG KEY PREFIX EXCLUDE REPEAT) |
986 | 1006 |
987 MACRO is the macro. Arguments should be denoted by empty braces like | 1007 MACRO is the macro. Arguments should be denoted by empty braces like |
988 \\index[]{*}. Use square brackets to denote optional arguments. The star | 1008 \\index[]{*}. Use square brackets to denote optional arguments. The star |
989 marks where the index key is. | 1009 marks where the index key is. |
990 | 1010 |
1001 prefix should be \"Molecules!\". See the manual for details. | 1021 prefix should be \"Molecules!\". See the manual for details. |
1002 | 1022 |
1003 EXCLUDE can be a function. If this function exists and returns a non-nil | 1023 EXCLUDE can be a function. If this function exists and returns a non-nil |
1004 value, the index entry at point is ignored. This was implemented to support | 1024 value, the index entry at point is ignored. This was implemented to support |
1005 the (deprecated) `^' and `_' shortcuts in the LaTeX2e `index' package. | 1025 the (deprecated) `^' and `_' shortcuts in the LaTeX2e `index' package. |
1026 | |
1027 REPEAT, if non-nil, means the index macro does not typeset the entry in | |
1028 the text, so that the text has to be repeated outside the index macro. | |
1029 Needed for `reftex-index-selection-or-word' and for indexing from the | |
1030 phrase buffer. | |
1006 | 1031 |
1007 The final entry may also be a symbol if this entry has a association | 1032 The final entry may also be a symbol if this entry has a association |
1008 in the variable `reftex-index-macros-builtin' to specify the main | 1033 in the variable `reftex-index-macros-builtin' to specify the main |
1009 indexing package you are using. Legal values are currently | 1034 indexing package you are using. Legal values are currently |
1010 default The LaTeX default - unnecessary to specify this one | 1035 default The LaTeX default - unnecessary to specify this one |
1019 :set 'reftex-set-dirty | 1044 :set 'reftex-set-dirty |
1020 :type `(list | 1045 :type `(list |
1021 (repeat | 1046 (repeat |
1022 :inline t | 1047 :inline t |
1023 (list :value ("" "idx" ?a "" nil) | 1048 (list :value ("" "idx" ?a "" nil) |
1024 (string :tag "Macro with args") | 1049 (string :tag "Macro with args") |
1025 (choice :tag "Index Tag " | 1050 (choice :tag "Index Tag " |
1026 (string) | 1051 (string) |
1027 (integer :tag "Macro arg Nr" :value 1)) | 1052 (integer :tag "Macro arg Nr" :value 1)) |
1028 (character :tag "Access Key ") | 1053 (character :tag "Access Key ") |
1029 (string :tag "Key Prefix ") | 1054 (string :tag "Key Prefix ") |
1030 (symbol :tag "Exclusion hook "))) | 1055 (symbol :tag "Exclusion hook ") |
1056 (boolean :tag "Repeat Outside "))) | |
1031 (option | 1057 (option |
1032 :tag "Package:" | 1058 :tag "Package:" |
1033 (choice :tag "Package" | 1059 (choice :tag "Package" |
1034 :value index | 1060 :value index |
1035 ,@(mapcar | 1061 ,@(mapcar |
1037 (list 'const :tag (concat (symbol-name (nth 0 x)) | 1063 (list 'const :tag (concat (symbol-name (nth 0 x)) |
1038 ": " (nth 1 x)) | 1064 ": " (nth 1 x)) |
1039 (nth 0 x))) | 1065 (nth 0 x))) |
1040 reftex-index-macros-builtin))))) | 1066 reftex-index-macros-builtin))))) |
1041 | 1067 |
1042 (defcustom reftex-index-default-macro '(?i "idx" t) | 1068 (defcustom reftex-index-default-macro '(?i "idx") |
1043 "The default index macro for \\[reftex-index-selection-or-word]. | 1069 "The default index macro for \\[reftex-index-selection-or-word]. |
1044 This is a list with (MACRO-KEY DEFAULT-TAG REPEAT-WORD). | 1070 This is a list with (MACRO-KEY DEFAULT-TAG). |
1045 | 1071 |
1046 MACRO-KEY: Character identifying an index macro - see `reftex-index-macros'. | 1072 MACRO-KEY: Character identifying an index macro - see `reftex-index-macros'. |
1047 DEFAULT-TAG: This is the tag to be used if the macro requires a TAG argument. | 1073 DEFAULT-TAG: This is the tag to be used if the macro requires a TAG argument. |
1048 When this is nil and a TAG is needed, RefTeX will ask for it. | 1074 When this is nil and a TAG is needed, RefTeX will ask for it. |
1049 When this is the empty string and the TAG argument of the index | 1075 When this is the empty string and the TAG argument of the index |
1050 macro is optional, the TAG argument will be omitted. | 1076 macro is optional, the TAG argument will be omitted." |
1051 REPEAT-WORD: Non-nil means, the index macro does not typeset the entry in | |
1052 the text, so that the text has to be repeated outside the index | |
1053 macro." | |
1054 :group 'reftex-index-support | 1077 :group 'reftex-index-support |
1055 :type '(list | 1078 :type '(list |
1056 (character :tag "Character identifying default macro") | 1079 (character :tag "Character identifying default macro") |
1057 (choice :tag "Default index tag " | 1080 (choice :tag "Default index tag " |
1058 (const nil) | 1081 (const nil) |
1059 (string)) | 1082 (string)))) |
1060 (boolean :tag "Word needs to be repeated "))) | |
1061 | 1083 |
1062 (defcustom reftex-index-default-tag "idx" | 1084 (defcustom reftex-index-default-tag "idx" |
1063 "Default index tag. | 1085 "Default index tag. |
1064 When working with multiple indexes, RefTeX queries for an index tag when | 1086 When working with multiple indexes, RefTeX queries for an index tag when |
1065 creating index entries or displaying a specific index. This variable controls | 1087 creating index entries or displaying a specific index. This variable controls |
1082 through the `format' function. This can be used to add the math delimiters | 1104 through the `format' function. This can be used to add the math delimiters |
1083 (e.g. `$') to the string. | 1105 (e.g. `$') to the string. |
1084 Requires the `texmathp.el' library which is part of AUCTeX." | 1106 Requires the `texmathp.el' library which is part of AUCTeX." |
1085 :group 'reftex-index-support | 1107 :group 'reftex-index-support |
1086 :type 'string) | 1108 :type 'string) |
1109 | |
1110 (defcustom reftex-index-phrases-logical-and-regexp " *&& *" | |
1111 "Regexp matching the `and' operator for index arguments in phrases file. | |
1112 When several index arguments in a phrase line are separated by this | |
1113 operator, each part will generate an index macro. So each match of | |
1114 the search phrase will produce *several* different index entries. | |
1115 | |
1116 Note: make sure this does no match things which are not separators. | |
1117 This logical `and' has higher priority than the logical `or' specified in | |
1118 `reftex-index-phrases-logical-or-regexp'." | |
1119 :group 'reftex-index-support | |
1120 :type 'regexp) | |
1121 | |
1122 (defcustom reftex-index-phrases-logical-or-regexp " *|| *" | |
1123 "Regexp matching the `or' operator for index arguments in phrases file. | |
1124 When several index arguments in a phrase line are separated by this | |
1125 operator, the user will be asked to select one of them at each match | |
1126 of the search phrase. The first index arg will be the default - a | |
1127 number key 1-9 must be pressed to switch to another. | |
1128 | |
1129 Note: make sure this does no match things which are not separators. | |
1130 The logical `and' specified in `reftex-index-phrases-logical-or-regexp' | |
1131 has higher priority than this logical `or'." | |
1132 :group 'reftex-index-support | |
1133 :type 'regexp) | |
1134 | |
1135 (defcustom reftex-index-phrases-search-whole-words t | |
1136 "*Non-nil means phrases search will look for whole words, not subwords. | |
1137 This works by requiring word boundaries at the beginning and end of | |
1138 the search string. When the search phrase already has a non-word-char | |
1139 at one of these points, no word boundary is required there." | |
1140 :group 'reftex-index-support | |
1141 :type 'boolean) | |
1142 | |
1143 (defcustom reftex-index-phrases-case-fold-search t | |
1144 "*Non-nil means, searching for index phrases will ignore case." | |
1145 :group 'reftex-index-support | |
1146 :type 'boolean) | |
1147 | |
1148 (defcustom reftex-index-phrases-skip-indexed-matches nil | |
1149 "*Non-nil means, skip matches which appear to be indexed already. | |
1150 When doing global indexing from the phrases buffer, searches for some | |
1151 phrases may match at places where that phrase was already indexed. In | |
1152 particular when indexing an already processed document again, this | |
1153 will even be the norm. When this variable is non-nil, RefTeX checks if | |
1154 the match is an index macro argument, or if an index macro is directly | |
1155 before or after the phrase. If that is the case, that match will | |
1156 be ignored." | |
1157 :group 'reftex-index-support | |
1158 :type 'boolean) | |
1159 | |
1160 (defcustom reftex-index-phrases-wrap-long-lines nil | |
1161 "*Non-nil means, when indexing from the phrases buffer, wrap lines. | |
1162 Inserting indexing commands in a line makes the line longer - often | |
1163 so long that it does not fit onto the screen. When this variable is | |
1164 non-nil, newlines will be added as necessary before and/or after the | |
1165 indexing command to keep lines short. However, the matched text | |
1166 phrase and its index command will always end up on a single line.") | |
1167 | |
1168 (defcustom reftex-index-phrases-sort-prefers-entry nil | |
1169 "*Non-nil means when sorting phrase lines, the explicit index entry is used. | |
1170 Phrase lines in the phrases buffer contain a search phrase, and | |
1171 sorting is normally based on these. Some phrase lines also have | |
1172 an explicit index argument specified. When this variable is non-nil, | |
1173 the index argument will be used for sorting." | |
1174 :group 'reftex-index-support | |
1175 :type 'boolean) | |
1176 | |
1177 (defcustom reftex-index-phrases-sort-in-blocks t | |
1178 "*Non-nil means, empty and comment lines separate phrase buffer into blocks. | |
1179 Sorting will then preserve blocks, so that lines are re-arranged only | |
1180 within blocks." | |
1181 :group 'reftex-index-support | |
1182 :type 'boolean) | |
1087 | 1183 |
1088 (defcustom reftex-index-section-letters "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | 1184 (defcustom reftex-index-section-letters "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
1089 "The letters which denote sections in the index. | 1185 "The letters which denote sections in the index. |
1090 Usually these are all capital letters. Don't use any downcase letters. | 1186 Usually these are all capital letters. Don't use any downcase letters. |
1091 Order is not significant, the index will be sorted by whatever the sort | 1187 Order is not significant, the index will be sorted by whatever the sort |