summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>1998-05-25 11:25:48 +0000
committerDave Love <fx@gnu.org>1998-05-25 11:25:48 +0000
commit2c0b59e3ebc24142f410f8f932e4b48b43628160 (patch)
tree4dd59f71321ba8043bfb98c80363adf461c186dc /lisp
parent2feaf204b04935ceeb81f919781dc83944042d4b (diff)
downloademacs-2c0b59e3ebc24142f410f8f932e4b48b43628160.tar.gz
(f90-comment-indent): Don't attempt to indent trailing comment as
code. (f90-looking-at-if-then): Don't lose with scan-lists on bad syntax.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/f90.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index c851f2091ee..857fe7cfa4e 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -989,7 +989,8 @@ Name is nil if the statement has no label."
(setq struct (f90-match-piece 3))
(if (looking-at "\\(\\sw+\\)[ \t]*\:")
(setq label (f90-match-piece 1)))
- (goto-char (scan-lists (point) 1 0))
+ (let ((pos (scan-lists (point) 1 0)))
+ (and pos (goto-char pos)))
(skip-chars-forward " \t")
(if (or (looking-at "then\\>")
(if (f90-line-continued)
@@ -1041,7 +1042,11 @@ Name is non-nil only for type."
((and f90-directive-comment-re
(looking-at f90-directive-comment-re)) 0)
((looking-at (regexp-quote f90-comment-region)) 0)
- ((looking-at f90-indented-comment-re)
+ ((and (looking-at f90-indented-comment-re)
+ ;; Don't attempt to indent trailing comment as code.
+ (save-excursion
+ (skip-chars-backward " \t")
+ (bolp)))
(f90-calculate-indent))
(t (skip-chars-backward " \t")
(max (if (bolp) 0 (1+ (current-column))) comment-column))))