The functions f90-beginning-of-subprogram and f90-end-of-subprogram do not work correctly if the source file contains lines which begin with the correct keywords but in fact belong to a continued string. For instance, in the following,
subroutine foo() print*, '& end subroutine foo' ! The cursor is here end subroutine foo
f90-beginning-of-subprogram jumps past the line containing 'subroutine foo()'. A similar example could be written for f90-end-of-subprogram. I propose to put a small check of whether the previous line ended with an ampersand into the F90 major mode source file: