The following works.
(defun latex-isearch-in-math ()
"Call `isearch-forward' with `isearch-filter-predicate' set to filter out matches outside LaTeX math environments."
(lambda (BEG END)
(save-excursion (save-match-data (goto-char BEG) (texmathp)))))
This answer is a little bit delayed, but I stumbled over a similar problem. One solution could be to use the package pdf-tools. Installing this on macOS (if you are using this OS) can be quite challenging. I went this path and following this answer was fruitful. Additionally, the following lines in the .emacs or init.el file are potentially needed to ...
In case you're using fancyvrb.sty to define your custom environment, you only need to hit C-c C-n and let AUCTeX parse your document. AUCTeX has a sophisticated style file for fancyvrb.sty which takes care of adding your environment to various internal variables. After that, you can do C-c C-e myverTAB RET to include it in your document. AUCTeX will ...
Add your self-defined verbatim environment to LaTeX-indent-environment-list.
Your modified example would look like this:
that LaTeX-fill-region does something.
First verbatim line.
Second verbatim line.
% Local ...
If reftex is enabled and the variable reftex-plug-into-AUCTeX is not nil the value of LaTeX-section-labelis ignored and reftex-section-prefixes is used. Its default value is
((0 . "part:")
(1 . "cha:")
(t . "sec:"))