Ah, I found something interesting. The \begin{lstlisting}[label=...] environment
adds the label to the "listing" type, found in RefTeX when pressing 'l' for the
Label Type prompt, I was used to that. In this case, however, the
\lstinputlisting[label=...] label seems to be added to the "section" Label Type,
found when pressing 's' or ' '. So I can find it with 'C-c ) RET SPACE' or 'C-c
) RET s'. Thanks, this helps a bunch!

I hadn't tried that yet since I was still mindlessly pressing 'l' to see the
listing type labels. I might need to change my working method somewhat, since I
usually press 'l' to see all listings, and now I might need to press ' ' and
find the label in a bit more noise.

Arash Esbati <[email protected]> writes:

> Here is what I see in my testing after hitting 'C-c C-m ref RET SPACE':
> x
> Selecting the label in *RefTeX Select* buffer enters the label in my
> .tex file, so it works here.

I don't get the *RefTeX Select* buffer popup with the process you describe. When
I do 'C-c C-m ref RET' I just get a minibuffer "Key: " prompt:
Pressing SPACE errors and gives "[No match]", even though I can find it via
(reftex-reference). So, the *RefTeX Select* buffer only occurs via 'C-c ) RET',
or (reftex-reference), which seems different from you.

> Strange.  Which version of Emacs are you using, and how did you install
> AUCTeX?

This is all for Emacs version
     
     GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo 
version 1.18.2)

I usually install auctex via straight.el, like this:

(use-package auctex
  :straight t
  ...
  :hook
  (LaTeX-mode . reftex-mode))

But I also tested it with emacs -Q, where I just did (package-install 'auctex).

Hope this helps a bit. At least I can continue, reftex seems to find the listing
label, I just assumed that it would add it to the listing type, but how could it
know that via just the regexp? Thanks!

Best,
Rens

Reply via email to