Function: f90-next-block

f90-next-block is an interactive and byte-compiled function defined in f90.el.gz.

Signature

(f90-next-block &optional NUM)

Documentation

Move point forward to the next end or start of a code block.

With optional argument NUM, go forward that many blocks. If NUM is negative, go backwards. A block is a subroutine, if-endif, etc.

View in manual

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/f90.el.gz
(defun f90-next-block (&optional num)
  "Move point forward to the next end or start of a code block.
With optional argument NUM, go forward that many blocks.
If NUM is negative, go backwards.
A block is a subroutine, if-endif, etc."
  (interactive "p")
  (let ((case-fold-search t)
        (count (if num (abs num) 1)))
    (while (and (> count 0)
                (if (> num 0) (re-search-forward f90-blocks-re nil 'move)
                  (re-search-backward f90-blocks-re nil 'move)))
      (beginning-of-line)
      (skip-chars-forward " \t0-9")
      (cond ((or (f90-in-string) (f90-in-comment)))
            ((or
              (looking-at "end[ \t]*")
              (f90-looking-at-do)
              (f90-looking-at-select-case)
              (f90-looking-at-type-like)
              (f90-looking-at-associate)
              (f90-looking-at-critical)
              (f90-looking-at-program-block-start)
              (f90-looking-at-if-then)
              (f90-looking-at-where-or-forall))
             (setq count (1- count))))
      (if (> num 0) (end-of-line)
        (beginning-of-line)))))