emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106035: f90 indentation fix.


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106035: f90 indentation fix.
Date: Sat, 08 Oct 2011 14:52:08 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106035
fixes bug(s): http://debbugs.gnu.org/9690
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2011-10-08 14:52:08 -0700
message:
  f90 indentation fix.
  
  * lisp/progmodes/f90.el (f90-calculate-indent):
  Give preprocessor lines before the first code statement zero indent.
modified:
  lisp/ChangeLog
  lisp/progmodes/f90.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-08 16:37:46 +0000
+++ b/lisp/ChangeLog    2011-10-08 21:52:08 +0000
@@ -1,3 +1,8 @@
+2011-10-08  Glenn Morris  <address@hidden>
+
+       * progmodes/f90.el (f90-calculate-indent): Give preprocessor lines
+       before the first code statement zero indent.  (Bug#9690)
+
 2011-10-08  Chong Yidong  <address@hidden>
 
        * simple.el (count-words-region): Always count in the region.

=== modified file 'lisp/progmodes/f90.el'
--- a/lisp/progmodes/f90.el     2011-09-20 06:36:45 +0000
+++ b/lisp/progmodes/f90.el     2011-10-08 21:52:08 +0000
@@ -1489,14 +1489,19 @@
       (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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]