diff options
| author | Tassilo Horn | 2013-04-15 09:55:05 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2013-04-15 09:55:05 +0200 |
| commit | 4d9a0979f6930ef23ef0b05996cc737002b25e06 (patch) | |
| tree | f4bab59c898d591955ff686a80b06a2b07606472 | |
| parent | 5fbcd237859a2f7979e2cff3bf6f3ac56f2bfa24 (diff) | |
| download | emacs-4d9a0979f6930ef23ef0b05996cc737002b25e06.tar.gz emacs-4d9a0979f6930ef23ef0b05996cc737002b25e06.zip | |
* textmodes/reftex-vars.el (reftex-label-regexps): New defcustom.
* textmodes/reftex.el (reftex-compile-variables): Use it.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-vars.el | 14 | ||||
| -rw-r--r-- | lisp/textmodes/reftex.el | 8 |
3 files changed, 21 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0997a307f5..34711b72c3e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-04-15 Tassilo Horn <tsdh@gnu.org> | ||
| 2 | |||
| 3 | * textmodes/reftex-vars.el (reftex-label-regexps): New defcustom. | ||
| 4 | |||
| 5 | * textmodes/reftex.el (reftex-compile-variables): Use it. | ||
| 6 | |||
| 1 | 2013-04-14 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-04-14 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * files.el (normal-mode): Only use default major-mode if no other mode | 9 | * files.el (normal-mode): Only use default major-mode if no other mode |
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 2a5c9c55866..c00cf36c79e 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el | |||
| @@ -863,6 +863,20 @@ DOWNCASE t: Downcase words before using them." | |||
| 863 | (string :tag "")) | 863 | (string :tag "")) |
| 864 | (option (boolean :tag "Downcase words ")))) | 864 | (option (boolean :tag "Downcase words ")))) |
| 865 | 865 | ||
| 866 | (defcustom reftex-label-regexps | ||
| 867 | '(;; Normal \\label{foo} labels | ||
| 868 | "\\\\label{\\(?1:[^}]*\\)}" | ||
| 869 | ;; keyvals [..., label = {foo}, ...] forms used by ctable, | ||
| 870 | ;; listings, minted, ... | ||
| 871 | "\\[[^]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?") | ||
| 872 | "List of regexps matching \\label definitions. | ||
| 873 | The default value matches usual \\label{...} definitions and | ||
| 874 | keyval style [..., label = {...}, ...] label definitions. It is | ||
| 875 | assumed that the regexp group 1 matches the label text, so you | ||
| 876 | have to define it using \\(?1:...\\) when adding new regexps." | ||
| 877 | :group 'reftex-defining-label-environments | ||
| 878 | :type '(repeat (regexp :tag "Regular Expression"))) | ||
| 879 | |||
| 866 | (defcustom reftex-label-illegal-re "[^-a-zA-Z0-9_+=:;,.]" | 880 | (defcustom reftex-label-illegal-re "[^-a-zA-Z0-9_+=:;,.]" |
| 867 | "Regexp matching characters not valid in labels." | 881 | "Regexp matching characters not valid in labels." |
| 868 | :group 'reftex-making-and-inserting-labels | 882 | :group 'reftex-making-and-inserting-labels |
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index d5bb0170cd9..21083fd188a 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el | |||
| @@ -1081,13 +1081,7 @@ This enforces rescanning the buffer on next use." | |||
| 1081 | (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because | 1081 | (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because |
| 1082 | ; match numbers are hard coded | 1082 | ; match numbers are hard coded |
| 1083 | (label-re (concat "\\(?:" | 1083 | (label-re (concat "\\(?:" |
| 1084 | ;; Normal \label{...} | 1084 | (mapconcat 'identity reftex-label-regexps "\\|") |
| 1085 | "\\\\label{\\([^}]*\\)}" | ||
| 1086 | "\\|" | ||
| 1087 | ;; keyvals [..., label = {foo}, ...] | ||
| 1088 | ;; forms used by ctable, listings, | ||
| 1089 | ;; minted, ... | ||
| 1090 | "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?" | ||
| 1091 | "\\)")) | 1085 | "\\)")) |
| 1092 | (include-re (concat wbol | 1086 | (include-re (concat wbol |
| 1093 | "\\\\\\(" | 1087 | "\\\\\\(" |