Function: idlwave-start-of-substatement

idlwave-start-of-substatement is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-start-of-substatement &optional PRE)

Documentation

Move to start of next IDL substatement after point.

Uses the type of the current IDL statement to determine if the next statement is on a new line or is a subpart of the current statement. Returns point at start of substatement modulo whitespace. If optional argument is non-nil move to beginning of current substatement.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
(defun idlwave-start-of-substatement (&optional pre)
  "Move to start of next IDL substatement after point.
Uses the type of the current IDL statement to determine if the next
statement is on a new line or is a subpart of the current statement.
Returns point at start of substatement modulo whitespace.
If optional argument is non-nil move to beginning of current
substatement."
  (let ((orig (point))
        (eos (idlwave-end-of-statement))
        (ifnest 0)
        st nst last)
    (idlwave-beginning-of-statement)
    (idlwave-skip-label-or-case)
    (if (< (point) orig)
	(idlwave-skip-multi-commands orig))
    (setq last (point))
    ;; Continue looking for substatements until we are past orig
    (while (and (<= (point) orig) (not (eobp)))
      (setq last (point))
      (setq nst (nth 1 (cdr (setq st (car (idlwave-statement-type))))))
      (if (equal (car st) 'if) (setq ifnest (1+ ifnest)))
      (cond ((and nst
                  (idlwave-find-key nst 1 'nomark eos))
             (goto-char (match-end 0)))
            ((and (> ifnest 0) (idlwave-find-key "\\<else\\>" 1 'nomark eos))
             (setq ifnest (1- ifnest))
             (goto-char (match-end 0)))
            (t (setq ifnest 0)
               (idlwave-next-statement))))
    (if pre (goto-char last))
    ;; If a continuation line starts here, move to next line
    (if (looking-at "[ \t]*\\$\\([ \t]*\\(;\\|$\\)\\)")
	(beginning-of-line 2))
    (point)))