GNU bug report logs - #59638
13.0.9; reftex-toc counts incorrectly if section is commented out

Previous Next

Package: auctex;

Reported by: Uwe Brauer <oub <at> mat.ucm.es>

Date: Sun, 27 Nov 2022 17:27:02 UTC

Severity: normal

Found in version 13.0.9

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Uwe Brauer <oub <at> mat.ucm.es>
To: Arash Esbati <arash <at> gnu.org>
Cc: Uwe Brauer <oub <at> mat.ucm.es>, 59638 <at> debbugs.gnu.org,
 Tassilo Horn <tsdh <at> gnu.org>
Subject: Re: bug#59638: 13.0.9; reftex-toc counts incorrectly if section is
 commented out
Date: Mon, 28 Nov 2022 18:12:47 +0100
[Message part 1 (text/plain, inline)]
>>> "AE" == Arash Esbati <arash <at> gnu.org> writes:

> Hi Tassilo,
> Tassilo Horn <tsdh <at> gnu.org> writes:

>> I'd call it a feature.  I mean, when you have commented out sections,
>> you'll most probably intend to uncomment them again.  Otherwise, you
>> could just delete them, no?

Not really. Sometimes these constructions are the product of certain
converters.

So 

\section{Theorem 1: Global existence}
instead of 
\begin{thm}[Global existence]
\end{thm}

I end up quicker commenting this stuff out.....

> This feature was introduced with commit 1e8bb313ea in reftex.el.  The
> change was good to make RefTeX recognize sectioning macros in .dtx file,
> but I'd consider the behavior in regular .tex files as wrong.  What do
> you think about this change:

> diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
> index e72576cdc7..c72dd5fa07 100644
> --- a/lisp/textmodes/reftex.el
> +++ b/lisp/textmodes/reftex.el
> @@ -1005,9 +1005,13 @@ reftex-compile-variables

>      ;; Calculate the regular expressions
>      (let* (
> -;          (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
> -           (wbol "\\(^\\)%?[ \t]*") ; Need to keep the empty group because
> -                                    ; match numbers are hard coded
> +           ;; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
> +           ;; Need to keep the empty group because match numbers are
> +           ;; hard coded
> +           (wbol (concat "\\(^\\)"
> +                         (when (string-suffix-p ".dtx" (buffer-file-name) t)
> +                           "%")
> +                         "[ \t]*"))
>             (label-re (concat "\\(?:"
>                              (mapconcat #'identity reftex-label-regexps "\\|")
>                              "\\)"))

I can try to test this later

> @Uwe: Meanwhile, you can try to comment out your sections like this:

> %% \section{foo}

> and you should get a correct TOC.

Confirmed thanks

Uwe 


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
[smime.p7s (application/pkcs7-signature, attachment)]

This bug report was last modified 2 years and 154 days ago.

Previous Next


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