auctex-devel
[Top][All Lists]

## Re: [AUCTeX-devel] [problems with TeX-arg-ref]

 From: Mosè Giordano Subject: Re: [AUCTeX-devel] [problems with TeX-arg-ref] Date: Wed, 16 Nov 2016 19:13:12 +0100

Hi Uwe,

2016-11-16 18:20 GMT+01:00 Uwe Brauer <address@hidden>:
> The problem is with the behavior of the last case.
>
> IMHO, when RefTeX is plugged in, the label should be inserted
> *automatically* without any prompt. That is the value of the label is
> automatically calculated by RefTeX. That, at least for me, is the whole
> point of RefTeX: one has not to bother and to keep track manually of the
> labels used (like oops is it label number 123 or 124, don't remember
> right now). [1]
>
>
>
> That is why I proposed
>
>
> (defvar exam-use-reftex nil
>   "Variable which controls whether to use reftex-label' or TeX-arg-ref'.
> Default is to use TeX-arg-literal'.")
> ; or Tex-exam-label
>
>
> (if exam-use-reftex
>     (defalias 'TeX-arg-literal 'reftex-label))
>
>    > \end{document}

I suspect you may want to use something like the LaTeX-label'
function, or ultimately call

(funcall LaTeX-label-function arg

if using LaTeX-label' is not possible, but I still don't know exactly
what you want to do.

> Footnotes:
> [1]  frankly, without starting a flamewar, assigning labels in AUCTeX
>      without RefTex is for my like using plain tex instead of LaTeX.

I don't think you'll be able to start a flame war.  I do love RefTeX
as much as you, but you should keep in mind that they're two separate
packages and things are not going to change in the near feature,
unless AUCTeX replaces the default TeX mode in Emacs and this looks
fairly unlikely for a number of reasons.

AUCTeX and RefTeX have a good interface, to the point that you, as a
developer, usually don't need to care of the other package as long as
you use the appropriate functions/variables.

Having a look to already written code is a good way to avoid wasting
time in reinventing the wheel.  This has been my workflow:
automatically inserting a new labels makes me think to "equation"
environment or sectioning command.  Let's have a look at how this task
is accomplished in AUCTeX:it uses LaTeX-label'.

Bye,
Mosè