Commit 6a900cf1 authored by Edward M. Reingold's avatar Edward M. Reingold
Browse files

(tex-goto-last-unclosed-latex-block): New function. Bound to C-c C-u in

parent 8f41fd64
......@@ -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{"))
(defun tex-goto-last-unclosed-latex-block ()
"Move point to the last unclosed \\begin{...}.
Mark is left at original location."
(let ((spot))
(condition-case nil
(error (error "Couldn't find unended \\begin")))
(setq spot (point)))
(goto-char spot)))
(defun tex-close-latex-block ()
"Creates an \\end{...} to match the last unclosed \\begin{...}."
(interactive "*")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment