Function: simula-next-statement

simula-next-statement is an interactive and byte-compiled function defined in simula.el.gz.

Signature

(simula-next-statement COUNT)

Documentation

Move forward COUNT statements.

If COUNT is negative, move backward instead.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/simula.el.gz
(defun simula-next-statement (count)
  "Move forward COUNT statements.
If COUNT is negative, move backward instead."
  (interactive "p")
  (if (< count 0)
      (simula-previous-statement (- count))
    (let (status
	  (case-fold-search t)
	  (origin (point)))
      (condition-case ()
	  (progn
	    (simula-skip-comment-forward)
	    (if (looking-at "\\<end\\>") (forward-word-strictly 1))
	    (while (and (natnump (setq count (1- count)))
			(setq status (simula-search-forward
				      ";\\|\\<end\\>" (point-max) 'move))))
	    (if (and status (/= (preceding-char) ?\;))
		(progn
		  (backward-word-strictly 1)
		  (simula-skip-comment-backward))))
	(error (progn (goto-char origin)
		      (error "Incomplete statement (too few ENDs)")))
        (quit (progn (goto-char origin) (signal 'quit nil)))))))