# HG changeset patch # User Edward M. Reingold # Date 767999727 0 # Node ID a480d11d55944b715f20c86606180fba5993b8b9 # Parent eb888748ca9bf16ac606abd2b57dee7ac5d2eb6e (tex-goto-last-unclosed-latex-block): New function. Bound to C-c C-u in tex-mode. diff -r eb888748ca9b -r a480d11d5594 lisp/textmodes/tex-mode.el --- a/lisp/textmodes/tex-mode.el Tue May 03 20:46:17 1994 +0000 +++ b/lisp/textmodes/tex-mode.el Tue May 03 21:15:27 1994 +0000 @@ -215,6 +215,7 @@ (define-key tex-mode-map "\C-c\C-i" 'tex-bibtex-file) (define-key tex-mode-map "\C-c\C-o" 'tex-latex-block) (define-key tex-mode-map "\C-c\C-e" 'tex-close-latex-block) + (define-key tex-mode-map "\C-c\C-u" 'tex-goto-last-unclosed-latex-block) (define-key tex-mode-map [menu-bar tex tex-validate-region] '("Validate Region" . tex-validate-region)) (define-key tex-mode-map [menu-bar tex validate-tex-buffer] @@ -702,6 +703,19 @@ (looking-at "\\\\end{")) (tex-last-unended-begin))) +(defun tex-goto-last-unclosed-latex-block () + "Move point to the last unclosed \\begin{...}. +Mark is left at original location." + (interactive) + (let ((spot)) + (save-excursion + (condition-case nil + (tex-last-unended-begin) + (error (error "Couldn't find unended \\begin"))) + (setq spot (point))) + (push-mark) + (goto-char spot))) + (defun tex-close-latex-block () "Creates an \\end{...} to match the last unclosed \\begin{...}." (interactive "*")