From: Edward M. Reingold Date: Tue, 3 May 1994 21:15:27 +0000 (+0000) Subject: (tex-goto-last-unclosed-latex-block): New function. Bound to C-c C-u in X-Git-Tag: emacs-19.34~8556 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6a900cf14e75d806009007e9730a1c14c7c7bc54;p=emacs.git (tex-goto-last-unclosed-latex-block): New function. Bound to C-c C-u in tex-mode. --- diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index f5c043a608c..afbae44e0d6 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -215,6 +215,7 @@ Set by \\[tex-region], \\[tex-buffer], and \\[tex-file].") (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 @@ Puts point on a blank line between them." (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 "*")