]> git.eshelyaron.com Git - emacs.git/commitdiff
(fortran-end-of-subprogram): Check for a match before trying to move
authorGlenn Morris <rgm@gnu.org>
Sun, 10 Aug 2008 20:09:13 +0000 (20:09 +0000)
committerGlenn Morris <rgm@gnu.org>
Sun, 10 Aug 2008 20:09:13 +0000 (20:09 +0000)
there (sync from trunk 2008-06-11).

lisp/progmodes/fortran.el

index 0e7fd0ee051546f527ac7ef9127e6a654b462997..c22f128a13b5378026c0f691f7e4a6e785d9258d 100644 (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.