Function: fortran-previous-statement

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

Signature

(fortran-previous-statement)

Documentation

Move point to beginning of the previous Fortran statement.

Returns first-statement if that statement is the first non-comment Fortran statement in the file, and nil otherwise. Directive lines are treated as comments.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/fortran.el.gz
(defun fortran-previous-statement ()
  "Move point to beginning of the previous Fortran statement.
Returns `first-statement' if that statement is the first
non-comment Fortran statement in the file, and nil otherwise.
Directive lines are treated as comments."
  (interactive)
  (let (not-first-statement continue-test)
    (beginning-of-line)
    (setq continue-test
          (and
           (not (looking-at fortran-comment-line-start-skip))
           (not (looking-at fortran-directive-re))
           (or (looking-at
                (concat "[ \t]*"
                        (regexp-quote fortran-continuation-string)))
               (looking-at " \\{5\\}[^ 0\n]\\|\t[1-9]"))))
    (while (and (setq not-first-statement (zerop (forward-line -1)))
                (or (looking-at fortran-comment-line-start-skip)
                    (looking-at fortran-directive-re)
                    (looking-at
                     (concat "[ \t]*"
                             (regexp-quote fortran-continuation-string)))
                    (looking-at "[ \t]*$\\| \\{5\\}[^ 0\n]\\|\t[1-9]")
                    (looking-at (concat "[ \t]*\\(?:"
                                        comment-start-skip "\\)")))))
    (cond ((and continue-test
                (not not-first-statement))
           (message "Incomplete continuation statement."))
          (continue-test
           (fortran-previous-statement))
          ((not not-first-statement)
           'first-statement))))