GNU bug report logs - #41841
26.3; reftex and tikz's labels

Previous Next

Package: emacs;

Reported by: phs <at> lsv.fr

Date: Sat, 13 Jun 2020 21:27:02 UTC

Severity: normal

Found in version 26.3

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41841 in the body.
You can then email your comments to 41841 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41841; Package emacs. (Sat, 13 Jun 2020 21:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to phs <at> lsv.fr:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 13 Jun 2020 21:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: phs <phs <at> lsv.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; reftex and tikz's labels
Date: Sat, 13 Jun 2020 23:26:11 +0200
It seems reftex mistakes labels in tikz nodes with genuine \label 's in
LaTeX
source.

To reproduce:

1) open a buffer foo.tex in LaTeX mode

2) insert (via cut&paste) the following text

\begin{figure}
\begin{tikzpicture}
\node at (0,0) [label={node 0}] % not a LaTeX label
\end{tikzpicture}
\caption{Figure that!}
\label{myfigure} % only genuine label
\end{figure}

3) M-x reftex-toc

4) in the TOC buffer, hit key l for reftex-toc-toggle-labels

5) now the TOC buffer shows a genuine LaTeX \label and an irrelevant
tikz node "label".

--phs

"Algebraic symbols are used when you do not know what you are talking about"

In GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20
Version 10.14.3 (Build 18D109))
 of 2019-09-02 built on builder10-14.porkrind.org
Windowing system distributor 'Apple', version 10.3.1894

Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS

Important settings:
  value of $LC_ALL: en_US
  value of $LANG: en_US
  locale-coding-system: utf-8-unix

Major mode: TOC

Minor modes in effect:
  cursor-intangible-mode: t
  global-magit-file-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  icomplete-mode: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t





Reply sent to Tassilo Horn <tsdh <at> gnu.org>:
You have taken responsibility. (Sun, 14 Jun 2020 20:18:01 GMT) Full text and rfc822 format available.

Notification sent to phs <at> lsv.fr:
bug acknowledged by developer. (Sun, 14 Jun 2020 20:18:02 GMT) Full text and rfc822 format available.

Message #10 received at 41841-done <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: phs <phs <at> lsv.fr>
Cc: 41841-done <at> debbugs.gnu.org
Subject: Re: bug#41841: 26.3; reftex and tikz's labels
Date: Sun, 14 Jun 2020 22:17:10 +0200
phs <phs <at> lsv.fr> writes:

> It seems reftex mistakes labels in tikz nodes with genuine \label 's
> in LaTeX source.
>
> To reproduce:
>
> 1) open a buffer foo.tex in LaTeX mode
>
> 2) insert (via cut&paste) the following text
>
> \begin{figure}
> \begin{tikzpicture}
> \node at (0,0) [label={node 0}] % not a LaTeX label
> \end{tikzpicture}
> \caption{Figure that!}
> \label{myfigure} % only genuine label
> \end{figure}

Does adding "tikzpicture" to
reftex-label-ignored-macros-and-environments work?

--8<---------------cut here---------------start------------->8---
reftex-label-ignored-macros-and-environments is a variable defined in ‘reftex-vars.el’.
Its value is nil

  You can customize this variable.
  This variable was introduced, or its default value was changed, in
  version 24.4 of Emacs.

Documentation:
List of macros and environments to be ignored when searching for labels.
The purpose is to ignore environments and macros that use keyval
style label=foo arguments, but the label has a different meaning
than a \label{foo}.  Standard \label{...} definitions are never
ignored.

E.g., TikZ defines several macros/environments where [label=foo]
defines the label to be printed at some node or edge, but it’s
not a label used for referencing.

Note that this feature is only supported if you are using AUCTeX
and the functions ‘TeX-current-macro’ and
‘LaTeX-current-environment’ are bound.  Also note that this
feature might slow down the reftex parsing process for large TeX
files.
--8<---------------cut here---------------end--------------->8---

In what's going to become Emacs 27.1, we are a bit more conservative and
have a whitelist of environments in which we look for label=foo options.
There, the bug doesn't happen anymore, so I'm closing this bug.

Thanks,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41841; Package emacs. (Sun, 14 Jun 2020 20:27:02 GMT) Full text and rfc822 format available.

Message #13 received at 41841-done <at> debbugs.gnu.org (full text, mbox):

From: phs <phs <at> lsv.fr>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 41841-done <at> debbugs.gnu.org
Subject: Re: bug#41841: 26.3; reftex and tikz's labels
Date: Sun, 14 Jun 2020 22:26:43 +0200
On 2020/06/14 22:17, Tassilo Horn wrote:

> Does adding "tikzpicture" to
> reftex-label-ignored-macros-and-environments work?

Yes, it works perfectly, even in my setup where I don't use AucTeX. Thanks!

Emacs is so full of options, it can do everything if you just know how
to use it properly.

I feel full of shame for posting a bug report about that. Sorry...

--phs




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41841; Package emacs. (Sun, 14 Jun 2020 20:30:03 GMT) Full text and rfc822 format available.

Message #16 received at 41841-done <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: phs <phs <at> lsv.fr>
Cc: 41841-done <at> debbugs.gnu.org
Subject: Re: bug#41841: 26.3; reftex and tikz's labels
Date: Sun, 14 Jun 2020 22:28:59 +0200
phs <phs <at> lsv.fr> writes:

>> Does adding "tikzpicture" to
>> reftex-label-ignored-macros-and-environments work?
>
> Yes, it works perfectly, even in my setup where I don't use
> AucTeX. Thanks!
>
> Emacs is so full of options, it can do everything if you just know how
> to use it properly.
>
> I feel full of shame for posting a bug report about that. Sorry...

No need to feel ashamed!  I think I've implemented that feature but
still I had to check the code in order to be sure.

Bye,
Tassilo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 13 Jul 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.