]> git.eshelyaron.com Git - emacs.git/commitdiff
(end-of-fortran-subprogram): Check if we're on the END statement.
authorDave Love <fx@gnu.org>
Thu, 2 Jul 1998 19:26:15 +0000 (19:26 +0000)
committerDave Love <fx@gnu.org>
Thu, 2 Jul 1998 19:26:15 +0000 (19:26 +0000)
lisp/progmodes/fortran.el

index 4b54bb16ed76048b79f094bb6c8ce1fc1a384ccb..dc622e675a14f25886d9b2f5d903288be68bd8b0 100644 (file)
@@ -904,10 +904,14 @@ Auto-indent does not happen if a numeric ARG is used."
   "Moves point to the end of the current Fortran subprogram."
   (interactive)
   (let ((case-fold-search t))
-    (beginning-of-line 2)
-    (re-search-forward fortran-end-prog-re nil 'move)
-    (goto-char (match-beginning 0))
-    (forward-line)))
+    (if (save-excursion                        ; on END
+         (beginning-of-line)
+         (looking-at fortran-end-prog-re))
+       (forward-line)
+      (beginning-of-line 2)
+      (re-search-forward fortran-end-prog-re nil 'move)
+      (goto-char (match-beginning 0))
+      (forward-line))))
 
 (defun mark-fortran-subprogram ()
   "Put mark at end of Fortran subprogram, point at beginning.