summaryrefslogtreecommitdiff
path: root/lisp/progmodes/f90.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-10-08 14:52:08 -0700
committerGlenn Morris <rgm@gnu.org>2011-10-08 14:52:08 -0700
commit0812589b0507ba6cad167d99d9c50fd30384cc33 (patch)
tree81587455c49c6a5be41b06287f21227b5acc5fcd /lisp/progmodes/f90.el
parentc8fd3bd078119d43056137316ac16f2f2ccbd6fd (diff)
downloademacs-0812589b0507ba6cad167d99d9c50fd30384cc33.tar.gz
f90 indentation fix.
* lisp/progmodes/f90.el (f90-calculate-indent): Give preprocessor lines before the first code statement zero indent. Fixes: debbugs:9690
Diffstat (limited to 'lisp/progmodes/f90.el')
-rw-r--r--lisp/progmodes/f90.el21
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index eb33822ce55..3d5c8a97835 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1489,14 +1489,19 @@ Does not check type and subprogram indentation."
(if (not (f90-previous-statement))
;; If f90-previous-statement returns nil, we must have been
;; called from on or before the first line of the first statement.
- (setq icol (if (save-excursion
- ;; f90-previous-statement has moved us over
- ;; comment/blank lines, so we need to get
- ;; back to the first code statement.
- (when (looking-at "[ \t]*\\([!#]\\|$\\)")
- (f90-next-statement))
- (skip-chars-forward " \t0-9")
- (f90-looking-at-program-block-start))
+ (setq icol (if (or (save-excursion
+ (goto-char pnt)
+ (beginning-of-line)
+ ;; Preprocessor line before code statement.
+ (looking-at "[ \t]*#"))
+ (progn
+ ;; f90-previous-statement has moved us over
+ ;; comment/blank lines, so we need to get
+ ;; back to the first code statement.
+ (when (looking-at "[ \t]*\\([!#]\\|$\\)")
+ (f90-next-statement))
+ (skip-chars-forward " \t0-9")
+ (f90-looking-at-program-block-start)))
0
;; No explicit PROGRAM start statement.
f90-program-indent))