diff options
author | Glenn Morris <rgm@gnu.org> | 2002-10-06 14:52:47 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2002-10-06 14:52:47 +0000 |
commit | f2dd9f8beb258d9b547270d766e94e3f030b379f (patch) | |
tree | 13e79d2eed2eca9d34832ca7ef2e533d6b99d6b0 | |
parent | 675634d705ab543dfaa6ae15ed435c621d176e61 (diff) | |
download | emacs-f2dd9f8beb258d9b547270d766e94e3f030b379f.tar.gz |
(fortran-beginning-do): Ignore labelled DO loops altogether.
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/progmodes/fortran.el | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d183ea2ef89..bc8a784c772 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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-01 Kenichi Handa <handa@m17n.org> * international/mule-diag.el (describe-coding-system): Describe diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 863b71b11fd..8ca65169d55 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -1086,12 +1086,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. @@ -1103,9 +1104,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) |