Function: simula-previous-statement

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

Signature

(simula-previous-statement COUNT)

Documentation

Move backward COUNT statements.

If COUNT is negative, move forward instead.

Key Bindings

Source Code

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