Hi all, I like narrowing and I wrote these two simple functions to narrow (La)TeX code to the current environment and group:
--8<---------------cut here---------------start------------->8--- (defun LaTeX-narrow-to-environment (&optional arg) "Make text outside current environment invisible. With optional ARG keep visible that number of enclosing environmens." (interactive "p") (save-excursion (if (equal (LaTeX-current-environment arg) "document") (message "Nothing to be narrowed here.") (widen) (LaTeX-mark-environment arg) (narrow-to-region (mark) (point))))) (defun TeX-narrow-to-group () "Make text outside current group invisible." (interactive) (save-excursion (widen) (let ((opoint (point)) beg end) (if (null (search-backward "{" nil t)) (message "Nothing to be narrowed here.") (setq beg (point)) (forward-sexp) (setq end (point)) (if (< end opoint) (message "Nothing to be narrowed here.") (narrow-to-region beg end)))))) --8<---------------cut here---------------end--------------->8--- I suggest to bind the first to `C-c n e' and the second to `C-c n g'. Do you think it's valuable to add them to AUCTeX? If yes, should we disable them by default? I didn't test these functions thoroughly, so improvements are welcome. Bye, Mosè _______________________________________________ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel