From d7faae566d3d8f3df90ae70030e4ee5a76623252 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Thu, 2 Jul 1998 19:26:15 +0000 Subject: [PATCH] (end-of-fortran-subprogram): Check if we're on the END statement. --- lisp/progmodes/fortran.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 4b54bb16ed7..dc622e675a1 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -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. -- 2.39.5