Function: meta-indent-unfinished-line
meta-indent-unfinished-line is a byte-compiled function defined in
meta-mode.el.gz.
Signature
(meta-indent-unfinished-line)
Documentation
Tell if the current line of code ends with an unfinished expression.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/meta-mode.el.gz
(defun meta-indent-unfinished-line ()
"Tell if the current line of code ends with an unfinished expression."
(save-excursion
(end-of-line)
;; Skip backward the comments.
(let ((point-not-in-string (point)))
(while (search-backward comment-start (point-at-bol) t)
(unless (meta-indent-in-string-p)
(setq point-not-in-string (point))))
(goto-char point-not-in-string))
;; Search for the end of the previous expression.
(if (search-backward ";" (point-at-bol) t)
(progn (while (and (meta-indent-in-string-p)
(search-backward ";" (point-at-bol) t)))
(if (= (char-after) ?\;)
(forward-char)
(beginning-of-line)))
(beginning-of-line))
;; See if the last statement of the line is environment-related,
;; or exists at all.
(if (meta-indent-looking-at-code
(concat "[ \t\f]*\\($\\|" (regexp-quote comment-start)
"\\|\\<" meta-end-environment-regexp "\\>"
"\\|\\<" meta-begin-environment-regexp "\\>"
"\\|\\<" meta-within-environment-regexp "\\>\\)"))
nil
t)))