(fortran-end-of-subprogram): Check for a match before trying to move

there (sync from trunk 2008-06-11).
This commit is contained in:
Glenn Morris 2008-08-10 20:09:13 +00:00
parent 9e7efbfa81
commit 8f010b8fbb

View file

@ -1122,12 +1122,12 @@ Auto-indent does not happen if a numeric ARG is used."
(fortran-check-end-prog-re)))
(forward-line)
(beginning-of-line 2)
(catch 'ok
(while (re-search-forward fortran-end-prog-re nil 'move)
(if (fortran-check-end-prog-re)
(throw 'ok t))))
(goto-char (match-beginning 0))
(forward-line)))))
(when (catch 'ok
(while (re-search-forward fortran-end-prog-re nil 'move)
(if (fortran-check-end-prog-re)
(throw 'ok t))))
(goto-char (match-beginning 0))
(forward-line))))))
(defun fortran-previous-statement ()
"Move point to beginning of the previous Fortran statement.