The attached patch is a middle ground between my narrowing function and the Nicolas' one, but I believe we should keep visible the enclosing `\begin' and `\end', because in some cases (i.e., when `\begin' starts at column 0 in the real file) this will help to maintain the correct indentation. Comments? I will add a brief description to the manual as well.
Looking at `LaTeX-mark-environment' code I noticed this:
--8<---------------cut here---------------start------------->8---
(dotimes (c count) (LaTeX-find-matching-end))
(setq end (line-beginning-position 2))
--8<---------------cut here---------------end--------------->8---
so the end of the marked region isn't the end of the `\end' macro but
the beginning of the next line. Consider the following case:
--8<---------------cut here---------------start------------->8---
\begin{document}\begin{itemize}\begin{equation}
--!--
\end{equation}\end{itemize}\end{document}
--8<---------------cut here---------------end--------------->8---
If point is at --!-- `LaTeX-mark-environment' will mark the region
from `\begin{equation}' to `\end{document}', which isn't the expected
result. Therefore I suggest to replace `(setq end
(line-beginning-position 2))' with `(setq end (point))'. Objections?
Bye,
Mosè
narrowing.patch
Description: Binary data
_______________________________________________ auctex-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex-devel
