changeset 22664:b685e806f640

(end-of-fortran-subprogram): Check if we're on the END statement.
author Dave Love <fx@gnu.org>
date Thu, 02 Jul 1998 19:26:15 +0000
parents 54d865200af8
children c6d48e73123e
files lisp/progmodes/fortran.el
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/fortran.el	Thu Jul 02 19:12:18 1998 +0000
+++ b/lisp/progmodes/fortran.el	Thu Jul 02 19:26:15 1998 +0000
@@ -904,10 +904,14 @@
   "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.