GNU bug report logs - #37861
bug in reftex: Change label and refs

Previous Next

Package: auctex;

Reported by: Manuel López-Ibáñez <lopezibanez <at> gmail.com>

Date: Tue, 22 Oct 2019 01:23:01 UTC

Severity: normal

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 37861 in the body.
You can then email your comments to 37861 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-auctex <at> gnu.org:
bug#37861; Package auctex. (Tue, 22 Oct 2019 01:23:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manuel López-Ibáñez <lopezibanez <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Tue, 22 Oct 2019 01:23:01 GMT) Full text and rfc822 format available.

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

From: Manuel López-Ibáñez <lopezibanez <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: bug in reftex: Change label and refs
Date: Mon, 21 Oct 2019 19:02:47 +0100
If I have this file:

\begin{document}
\ref{test}
test
\section{test}\label{test}
\end{document}

and I use "Change label and refs" I get this file:

\begin{document}
\ref{x}
test
\section{x}\label{x}
\end{document}

It doesn't make sense to change anything within \section{}. It should be 
limited to \ref and variants, and \label, perhaps with a customized var that 
contains all commands that take labels and which argument is the label, so that 
users can extend it.


Emacs  : GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
 of 2017-09-22, modified by Debian
Package: 11.91

current state:
==============
(setq
 AUCTeX-date "2017-07-24"
 window-system 'x
 LaTeX-version "2e"
 TeX-style-path '("/var/lib/auctex/emacs25/"
                  "/usr/share/emacs/site-lisp/auctex/style"
                  "/home/manu/.emacs.d/auctex/.auctex-auto"
                  "/home/manu/.emacs.d/auctex/style" ".auctex-auto" "style")
 TeX-auto-save t
 TeX-parse-self t
 TeX-master t
 TeX-command-list '(("TeX"
                     "%(PDF)%(tex) %(file-line-error) %(extraopts) 
%`%S%(PDFout)%(mode)%' %t"
                     TeX-run-TeX nil
                     (plain-tex-mode texinfo-mode ams-tex-mode) :help
                     "Run plain TeX")
                    ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil
                     (latex-mode doctex-mode) :help "Run LaTeX")
                    ("Makeinfo" "makeinfo %(extraopts) %t" TeX-run-compile nil
                     (texinfo-mode) :help "Run Makeinfo with Info output")
                    ("Makeinfo HTML" "makeinfo %(extraopts) --html %t"
                     TeX-run-compile nil (texinfo-mode) :help
                     "Run Makeinfo with HTML output")
                    ("AmSTeX" "amstex %(PDFout) %(extraopts) %`%S%(mode)%' %t"
                     TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX")
                    ("ConTeXt"
                     "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t"
                     TeX-run-TeX nil (context-mode) :help "Run ConTeXt once")
                    ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t"
                     TeX-run-TeX nil (context-mode) :help
                     "Run ConTeXt until completion")
                    ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help
                     "Run BibTeX")
                    ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber")
                    ("View" "%V" TeX-run-discard-or-function t t :help
                     "Run Viewer")
                    ("Print" "%p" TeX-run-command t t :help "Print the file")
                    ("Queue" "%q" TeX-run-background nil t :help
                     "View the printer queue" :visible TeX-queue-command)
                    ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t t :help
                     "Generate PostScript file")
                    ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil t :help
                     "Convert DVI file to PostScript")
                    ("Dvipdfmx" "dvipdfmx %d" TeX-run-dvipdfmx nil t :help
                     "Convert DVI file to PDF with dvipdfmx")
                    ("Ps2pdf" "ps2pdf %f" TeX-run-ps2pdf nil t :help
                     "Convert PostScript file to PDF")
                    ("Index" "makeindex %s.idx" TeX-run-index nil t :help
                     "Run makeindex to create index file")
                    ("Xindy" "texindy %s" TeX-run-command nil t :help
                     "Run xindy to create index file")
                    ("Check" "lacheck %s" TeX-run-compile nil (latex-mode)
                     :help "Check LaTeX file for correctness")
                    ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode)
                     :help "Check LaTeX file for common mistakes")
                    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil
                     t :help "Spell-check the document")
                    ("Clean" "TeX-clean" TeX-run-function nil t :help
                     "Delete generated intermediate files")
                    ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
                     "Delete generated intermediate and output files")
                    ("Other" "" TeX-run-command t t :help
                     "Run an arbitrary command")
                    )
 )




Reply sent to Tassilo Horn <tsdh <at> gnu.org>:
You have taken responsibility. (Wed, 23 Oct 2019 15:59:01 GMT) Full text and rfc822 format available.

Notification sent to Manuel López-Ibáñez <lopezibanez <at> gmail.com>:
bug acknowledged by developer. (Wed, 23 Oct 2019 15:59:01 GMT) Full text and rfc822 format available.

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

From: Tassilo Horn <tsdh <at> gnu.org>
To: Manuel López-Ibáñez <lopezibanez <at> gmail.com>
Cc: 37861-done <at> debbugs.gnu.org
Subject: Re: bug#37861: bug in reftex: Change label and refs
Date: Wed, 23 Oct 2019 17:58:24 +0200
Manuel López-Ibáñez <lopezibanez <at> gmail.com> writes:

Hi Manuel,

> If I have this file:
>
> \begin{document}
> \ref{test}
> test
> \section{test}\label{test}
> \end{document}
>
> and I use "Change label and refs" I get this file:
>
> \begin{document}
> \ref{x}
> test
> \section{x}\label{x}
> \end{document}
>
> It doesn't make sense to change anything within \section{}.

I can reproduce that with the current Emacs master (to be Emacs 27).

While I agree with you that this doesn't make sense in your example, I
don't see how we could make it the way you want without having the risk
of missing some occurrences.  There are so many \ref and \label
variants, and of course the user is free to add their own, i.e, by
wrapping existing ones, too.

Well, at least it's a query-replace so you are asked at each occurrence
going to be replaced (unless you answer with !).

> It should be limited to \ref and variants, and \label, perhaps with a
> customized var that contains all commands that take labels and which
> argument is the label, so that users can extend it.

Given that it is quite uncommon to have a \ref that equals a \section
title (at least RefTeX suggests something like sec:title-with-hypens by
default), I'd rather leave it as it is.  Having to customize a
hypothetical reftex-ref/label-macro-regexp to match any \ref/\label
variant whose default value will probably be frequently not up-to-date
with the latest LaTeX packages doesn't seem justified.

I'm closing this report for that reason.

Bye,
Tassilo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Nov 2019 12:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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