* bug#20820: 25.0.50; [PATCH] Default for reftex-label-regexps is too loose
@ 2015-06-15 19:02 Nils Ackermann
2015-06-16 7:27 ` Tassilo Horn
0 siblings, 1 reply; 2+ messages in thread
From: Nils Ackermann @ 2015-06-15 19:02 UTC (permalink / raw
To: 20820
The following valid latex test file shows the problem:
====
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{A}
[
\section{B}
\begin{enumerate}[label=a]
\item
\end{enumerate}
\end{document}
====
After loading `reftex', calling `reftex-toc' in the buffer with above
test file results in the following output:
====
TABLE-OF-CONTENTS on /path/to/test.tex
SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
------------------------------------------------------------------------------
1 A
====
while the following would be expected:
====
TABLE-OF-CONTENTS on /path/to/test.tex
SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
------------------------------------------------------------------------------
1 A
2 B
====
The default regexp in reftex-label-regexps consumes everything from the
first opening `[' until the `label=' clause, hiding relevant material in
between.
This is a problem because in mathematics texts unbalanced brackets
appear commonly. The gobbled up text is then not accessible from reftex
anymore.
Proposed fix:
---
lisp/textmodes/reftex-vars.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 7f050e9..4eb0432 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -876,7 +876,7 @@ DOWNCASE t: Downcase words before using them."
"\\\\label{\\(?1:[^}]*\\)}"
;; keyvals [..., label = {foo}, ...] forms used by ctable,
;; listings, minted, ...
- "\\[[^]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
+ "\\[[^[]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
"List of regexps matching \\label definitions.
The default value matches usual \\label{...} definitions and
keyval style [..., label = {...}, ...] label definitions. It is
--
1.9.1
In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu)
of 2015-06-15 on aphrodite
Repository revision: f0f216eaa1ebc84457812f66a5e714721245ef9d
System Description: Ubuntu 14.04.1 LTS
Configured using:
`configure --without-x'
Configured features:
JPEG SOUND DBUS NOTIFY ACL GNUTLS ZLIB
Important settings:
value of $LC_ALL: en_US.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Info
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Composing main Info directory...done
Found `--debug-init' in Option Index. (26 total; use `,' for next)
Found `debug_print' in Command Index. (26 total; use `,' for next)
Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils info tool-bar easymenu
term/xterm xterm byte-opt gv bytecomp byte-compile cl-extra seq
cl-loaddefs pcase cl-lib cconv time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list
newcomment elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow timer select mouse jit-lock font-lock syntax facemenu
font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind gfilenotify
multi-tty make-network-process emacs)
Memory information:
((conses 16 199619 6741)
(symbols 48 18902 0)
(miscs 40 68 248)
(strings 32 24335 7161)
(string-bytes 1 682421)
(vectors 16 9830)
(vector-slots 8 365902 7860)
(floats 8 114 255)
(intervals 56 34479 187)
(buffers 976 12)
(heap 1024 42239 918))
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#20820: 25.0.50; [PATCH] Default for reftex-label-regexps is too loose
2015-06-15 19:02 bug#20820: 25.0.50; [PATCH] Default for reftex-label-regexps is too loose Nils Ackermann
@ 2015-06-16 7:27 ` Tassilo Horn
0 siblings, 0 replies; 2+ messages in thread
From: Tassilo Horn @ 2015-06-16 7:27 UTC (permalink / raw
To: Nils Ackermann; +Cc: 20820
Nils Ackermann <nils@ackermath.info> writes:
Hi Nils,
> The default regexp in reftex-label-regexps consumes everything from
> the first opening `[' until the `label=' clause, hiding relevant
> material in between.
>
> This is a problem because in mathematics texts unbalanced brackets
> appear commonly. The gobbled up text is then not accessible from
> reftex anymore.
Thanks, I've applied your patch.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-16 7:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-15 19:02 bug#20820: 25.0.50; [PATCH] Default for reftex-label-regexps is too loose Nils Ackermann
2015-06-16 7:27 ` Tassilo Horn
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.