diff options
author | Glenn Morris <rgm@gnu.org> | 2005-04-24 19:42:28 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2005-04-24 19:42:28 +0000 |
commit | b78cbdf785eefe29c0917da8312f4ed54ae20c7d (patch) | |
tree | c1d4860c5b68063f4681bbd0e18350d7fbb724ed | |
parent | 2538808fd8b60753cad84b26092340695de4ce9b (diff) | |
download | emacs-b78cbdf785eefe29c0917da8312f4ed54ae20c7d.tar.gz |
(f90-calculate-indent): Fix treatment of first statement in buffer
(broken by 2004-11-24 change).
-rw-r--r-- | lisp/progmodes/f90.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 14363e4dccf..eb6db05c159 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -1109,9 +1109,15 @@ Does not check type and subprogram indentation." (let (icol cont (case-fold-search t) (pnt (point))) (save-excursion (if (not (f90-previous-statement)) - ;; First statement in buffer. + ;; 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-next-statement) + ;; 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. |