Mercurial > emacs
comparison lisp/progmodes/fortran.el @ 24254:93993abff564
(mark-fortran-subprogram): Activate mark
here...
(fortran-narrow-to-subprogram, fortran-indent-subprogram): ... not
here.
author | Dave Love <fx@gnu.org> |
---|---|
date | Tue, 02 Feb 1999 19:35:29 +0000 |
parents | 5c8305dd352f |
children | b4bf2212c418 |
comparison
equal
deleted
inserted
replaced
24253:39d5ef228cae | 24254:93993abff564 |
---|---|
978 (defun mark-fortran-subprogram () | 978 (defun mark-fortran-subprogram () |
979 "Put mark at end of Fortran subprogram, point at beginning. | 979 "Put mark at end of Fortran subprogram, point at beginning. |
980 The marks are pushed." | 980 The marks are pushed." |
981 (interactive) | 981 (interactive) |
982 (end-of-fortran-subprogram) | 982 (end-of-fortran-subprogram) |
983 (push-mark (point)) | 983 (push-mark (point) nil t) |
984 (beginning-of-fortran-subprogram)) | 984 (beginning-of-fortran-subprogram)) |
985 | 985 |
986 (defun fortran-previous-statement () | 986 (defun fortran-previous-statement () |
987 "Moves point to beginning of the previous Fortran statement. | 987 "Moves point to beginning of the previous Fortran statement. |
988 Returns `first-statement' if that statement is the first | 988 Returns `first-statement' if that statement is the first |
1032 (defun fortran-narrow-to-subprogram () | 1032 (defun fortran-narrow-to-subprogram () |
1033 "Make text outside the current subprogram invisible. | 1033 "Make text outside the current subprogram invisible. |
1034 The subprogram visible is the one that contains or follows point." | 1034 The subprogram visible is the one that contains or follows point." |
1035 (interactive) | 1035 (interactive) |
1036 (save-excursion | 1036 (save-excursion |
1037 (let ((mark-active t)) | 1037 (mark-fortran-subprogram) |
1038 (mark-fortran-subprogram) | 1038 (narrow-to-region (point) (mark)))) |
1039 (narrow-to-region (point) (mark))))) | |
1040 | 1039 |
1041 (defmacro fortran-with-subprogram-narrowing (&rest forms) | 1040 (defmacro fortran-with-subprogram-narrowing (&rest forms) |
1042 "Execute FORMS with buffer temporarily narrowed to current subprogram. | 1041 "Execute FORMS with buffer temporarily narrowed to current subprogram. |
1043 Doesn't push a mark." | 1042 Doesn't push a mark." |
1044 `(save-restriction | 1043 `(save-restriction |
1342 | 1341 |
1343 (defun fortran-indent-subprogram () | 1342 (defun fortran-indent-subprogram () |
1344 "Properly indent the Fortran subprogram which contains point." | 1343 "Properly indent the Fortran subprogram which contains point." |
1345 (interactive) | 1344 (interactive) |
1346 (save-excursion | 1345 (save-excursion |
1347 (let ((mark-active t)) | 1346 (mark-fortran-subprogram) |
1348 (mark-fortran-subprogram) | 1347 (message "Indenting subprogram...") |
1349 (message "Indenting subprogram...") | 1348 (indent-region (point) (mark) nil)) |
1350 (indent-region (point) (mark) nil))) | |
1351 (message "Indenting subprogram...done.")) | 1349 (message "Indenting subprogram...done.")) |
1352 | 1350 |
1353 (defun fortran-calculate-indent () | 1351 (defun fortran-calculate-indent () |
1354 "Calculates the Fortran indent column based on previous lines." | 1352 "Calculates the Fortran indent column based on previous lines." |
1355 (let (icol first-statement (case-fold-search t) | 1353 (let (icol first-statement (case-fold-search t) |