1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

(fortran-beginning-do): Ignore labelled DO loops altogether.

This commit is contained in:
Glenn Morris 2002-10-06 14:57:38 +00:00
parent f7d4343819
commit 845d331ee6
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2002-10-06 Glenn Morris <gmorris@ast.cam.ac.uk>
* progmodes/fortran.el (fortran-beginning-do): Ignore labelled DO
loops.
2002-10-04 Markus Rost <rost@math.ohio-state.edu>
* vc.el (vc-default-show-log-entry): Fix typo.

View file

@ -1104,12 +1104,13 @@ Return point or nil."
(defun fortran-beginning-do ()
"Search backwards for first unmatched DO [WHILE].
Return point or nil."
(let ((case-fold-search t))
Return point or nil. Ignores labelled DO loops (ie DO 10 ... 10 CONTINUE)."
(let ((case-fold-search t)
(dostart-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?do[ \t]+[^0-9]"))
(if (save-excursion
(beginning-of-line)
(skip-chars-forward " \t0-9")
(looking-at "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?do[ \t]+"))
(looking-at dostart-re))
;; Sitting on one.
(match-beginning 0)
;; Search for one.
@ -1121,9 +1122,9 @@ Return point or nil."
(not (and (looking-at fortran-end-prog-re)
(fortran-check-end-prog-re))))
(skip-chars-forward " \t0-9")
(cond ((looking-at
"\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?do[ \t]+")
(cond ((looking-at dostart-re)
(setq count (1- count)))
;; Note labelled loop ends not considered.
((looking-at "end[ \t]*do\\b")
(setq count (1+ count)))))
(and (= count 0)