Subject: 12.1.2; isearch with TeX-fold-mode and outline-minor-mode

From: Gustavo Barros <[email-masked]>
Date: Sun, 14 Jul 2019 11:58:44 -0300

Hi all,

When both TeX-fold-mode and outline-minor-mode are used together, if the
outline is folded, the usual unfolding of candidates of isearch does not work,
that is, temporary unfolding of the region where the current candidate is does
not happen. The unfolding of the region of the selected candidate also does 
not
happen.

Steps to reproduce:

Start `emacs -Q`

Some minimal setup:

#+begin_src emacs-lisp
(package-initialize)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
#+end_src

Now, visit file with contents:

#+begin_export latex
\documentclass{article}

\begin{document}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.\footnote{Nam dui ligula, fringilla a, euismod
  sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus
  libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet,
  tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio
  metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut
  massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et
  magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt
  urna.  Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus
  mauris.} Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus
sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus
sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium
quis, viverra ac, nunc.  Praesent eget sem vel leo ultrices bibendum. Aenean
faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-
abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue
eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci
dignissim rutrum.

\end{document}
#+end_export

Enable TeX-fold-mode and outline-minor-mode and fold content:

#+begin_src emacs-lisp
(TeX-fold-mode)
(outline-minor-mode)
(TeX-fold-buffer)
(outline-hide-body)
#+end_src

Now, use `isearch` to search for the string "morbi".  The text will remain
folded in the outline level, despite the four candidates being searched.

Disabling either `TeX-fold-mode` or `outline-minor-mode` brings the working of
each to the regular expected behavior.

Best regards,
Gustavo Barros.

Emacs  : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-04-19
Package: 12.1.2

current state:
==============
(setq
 AUCTeX-date "2019-02-08"
 window-system 'x
 LaTeX-version "2e"
 TeX-style-path '("~/.emacs.d/auctex" 
 "/home/gustavo/.emacs.d/elpa/auctex-12.1.2/style"
		  "/home/gustavo/.emacs.d/auctex/auto" 
		  "/home/gustavo/.emacs.d/auctex/style" "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 ams-tex-mode texinfo-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")
		    ("Glossaries" "makeglossaries %s" TeX-run-command nil t 
		    :help
		     "Run makeglossaries to create glossary file")
		    ("Index" "makeindex %s" TeX-run-index nil t :help "Run 
		    makeindex to create index file")
		    ("upMendex" "upmendex %s" TeX-run-index t t :help "Run 
		    upmendex 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"))
 )