Subject: bug#12483: Feature request: reftex-citation: skip menu for exact match

From: Arash Esbati <[email-masked]>
Date: Thu, 12 May 2022 13:18:59 +0200

Lars Ingebrigtsen <[email-masked]> writes:

> Michael Hoffman <[email-masked]> writes:
>
>> Would you consider changing reftex-citation so that if the supplied
>> argument exactly matches an existing citation key that it won't
>> display a menu of citations to choose from, but instead will just
>> enter the citation immediately?
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> Reftex is part of auctex, I think?  I've added the auctex bug list to
> the CCs; perhaps they have some comments here.

The way I see it this is by design.  Looking at the function
`reftex-extract-bib-entries-from-thebibliography' which does this part
of the work (invoked from `reftex-offer-bib-menu'), there is a comment
saying[1]:

;; Read a regexp, completing on known citation keys.

So you can choose one exact key but you're still "warped" to the
citation menu.  I suspect the reason is that you can do more stuff in
that buffer and not only saying "please insert this key".

If one wants to insert citation keys without the RefTeX procedure, I
suggest to use other complementary solutions like `TeX-complete-symbol'
(provided by AUCTeX) or possibly company-reftex-citations (provided by
company-reftex[2]).

Best, Arash

Footnotes:
[1]  http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/textmodes/reftex-cite.el?id=aeefa3a732c9dd815e23ed10c4582082acb0e29b#n404

[2]  https://github.com/TheBB/company-reftex