Function: ConTeXt-find-matching-start
ConTeXt-find-matching-start is an interactive and byte-compiled
function defined in context.el.
Signature
(ConTeXt-find-matching-start &optional INNER)
Documentation
Find beginning of current \start...\stop-Pair.
If INNER is non-nil, go to the point just past the \start... macro.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/context.el
(defun ConTeXt-find-matching-start (&optional inner)
"Find beginning of current \\start...\\stop-Pair.
If INNER is non-nil, go to the point just past the \\start... macro."
(interactive)
(let ((regexp (concat (regexp-quote TeX-esc)
"\\("
(ConTeXt-environment-start-name)
"\\|"
(ConTeXt-environment-stop-name)
"\\)"
))
(level 1)
(pos))
(while (and (> level 0)
(re-search-backward regexp nil t)
(cond ((looking-at (concat (regexp-quote TeX-esc)
(ConTeXt-environment-stop-name)))
(setq level (1+ level)))
((looking-at (concat (regexp-quote TeX-esc)
(ConTeXt-environment-start-name)))
(setq level (1- level))))))
;; now we have to look if we want to start behind the \start... macro
(when inner
;; \startfoo can have 0 or more {} and [] pairs. I assume that
;; skipping all those parens will be smart enough. It fails when
;; the first part in the \start-\stop-environment is { or [, like
;; in \startquotation {\em important} \stopquotation. There is
;; yet another pitfall: \startsetups SomeSetup foo bar
;; \stopsetups will use SomeSetup as the argument and the
;; environment
(skip-chars-forward "\\\\a-zA-Z")
(save-excursion
(while (progn
(skip-chars-forward "\t\n ")
(forward-comment 1)
(skip-chars-forward "\t\n ")
(looking-at "\\s\("))
(forward-list 1)
(setq pos (point))))
(when pos
(goto-char pos))
(unless (bolp)
(forward-line)))))