aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward M. Reingold1994-05-03 21:15:27 +0000
committerEdward M. Reingold1994-05-03 21:15:27 +0000
commit6a900cf14e75d806009007e9730a1c14c7c7bc54 (patch)
tree1b3a1aea7ba3e4be622b51013b0413926f5333d8
parent8f41fd649dc04fb778108532a217e291b130744d (diff)
downloademacs-6a900cf14e75d806009007e9730a1c14c7c7bc54.tar.gz
emacs-6a900cf14e75d806009007e9730a1c14c7c7bc54.zip
(tex-goto-last-unclosed-latex-block): New function. Bound to C-c C-u in
tex-mode.
-rw-r--r--lisp/textmodes/tex-mode.el14
1 files changed, 14 insertions, 0 deletions
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].")
215 (define-key tex-mode-map "\C-c\C-i" 'tex-bibtex-file) 215 (define-key tex-mode-map "\C-c\C-i" 'tex-bibtex-file)
216 (define-key tex-mode-map "\C-c\C-o" 'tex-latex-block) 216 (define-key tex-mode-map "\C-c\C-o" 'tex-latex-block)
217 (define-key tex-mode-map "\C-c\C-e" 'tex-close-latex-block) 217 (define-key tex-mode-map "\C-c\C-e" 'tex-close-latex-block)
218 (define-key tex-mode-map "\C-c\C-u" 'tex-goto-last-unclosed-latex-block)
218 (define-key tex-mode-map [menu-bar tex tex-validate-region] 219 (define-key tex-mode-map [menu-bar tex tex-validate-region]
219 '("Validate Region" . tex-validate-region)) 220 '("Validate Region" . tex-validate-region))
220 (define-key tex-mode-map [menu-bar tex validate-tex-buffer] 221 (define-key tex-mode-map [menu-bar tex validate-tex-buffer]
@@ -702,6 +703,19 @@ Puts point on a blank line between them."
702 (looking-at "\\\\end{")) 703 (looking-at "\\\\end{"))
703 (tex-last-unended-begin))) 704 (tex-last-unended-begin)))
704 705
706(defun tex-goto-last-unclosed-latex-block ()
707 "Move point to the last unclosed \\begin{...}.
708Mark is left at original location."
709 (interactive)
710 (let ((spot))
711 (save-excursion
712 (condition-case nil
713 (tex-last-unended-begin)
714 (error (error "Couldn't find unended \\begin")))
715 (setq spot (point)))
716 (push-mark)
717 (goto-char spot)))
718
705(defun tex-close-latex-block () 719(defun tex-close-latex-block ()
706 "Creates an \\end{...} to match the last unclosed \\begin{...}." 720 "Creates an \\end{...} to match the last unclosed \\begin{...}."
707 (interactive "*") 721 (interactive "*")