Function: vhdl-beginning-of-statement

vhdl-beginning-of-statement is an interactive and byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-beginning-of-statement &optional COUNT LIM INTERACTIVE)

Documentation

Go to the beginning of the innermost VHDL statement.

With prefix arg, go back N - 1 statements. If already at the beginning of a statement then go to the beginning of the preceding one. If within a string or comment, or next to a comment (only whitespace between), move by sentences instead of statements.

When called from a program, this function takes 3 optional args: the prefix arg, a buffer position limit which is the farthest back to search, and an argument indicating an interactive call.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-beginning-of-statement (&optional count lim interactive)
  "Go to the beginning of the innermost VHDL statement.
With prefix arg, go back N - 1 statements.  If already at the
beginning of a statement then go to the beginning of the preceding
one.  If within a string or comment, or next to a comment (only
whitespace between), move by sentences instead of statements.

When called from a program, this function takes 3 optional args: the
prefix arg, a buffer position limit which is the farthest back to
search, and an argument indicating an interactive call."
  (interactive "p\np")
  (let ((count (or count 1))
	(case-fold-search t)
	(lim (or lim (point-min)))
	(here (point))
	state)
    (save-excursion
      (goto-char lim)
      (setq state (parse-partial-sexp (point) here nil nil)))
    (if (and interactive
	     (or (nth 3 state)
		 (nth 4 state)
		 (looking-at (concat "[ \t]*\\(?:" comment-start-skip "\\)"))))
	(forward-sentence (- count))
      (while (> count 0)
	(vhdl-beginning-of-statement-1 lim)
	(setq count (1- count))))
    ;; its possible we've been left up-buf of lim
    (goto-char (max (point) lim))
    )
  (vhdl-keep-region-active))