emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#9690: closed (24.0.90; f90 mode incorrectly indent


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#9690: closed (24.0.90; f90 mode incorrectly indents top-level preprocessor directives)
Date: Sat, 08 Oct 2011 21:53:02 +0000

Your message dated Sat, 08 Oct 2011 17:52:35 -0400
with message-id <address@hidden>
and subject line Re: bug#9690: 24.0.90; f90 mode incorrectly indents top-level 
preprocessor directives
has caused the debbugs.gnu.org bug report #9690,
regarding 24.0.90; f90 mode incorrectly indents top-level preprocessor 
directives
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
9690: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9690
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.0.90; f90 mode incorrectly indents top-level preprocessor directives Date: Fri, 07 Oct 2011 12:37:50 +0100
emacs -Q

C-x b *tmp* RET

M-x f90-mode RET

M-: (insert "#include "foo.h") RET

TAB

Note how the preprocessor directive is indented by
f90-program-indent, rather than 0 spaces.

Patch and commit message

Cheers,
Lawrence


f90: Don't indent top-level preprocessor directives

* lisp/progmodes/f90.el (f90-calculate-indent): Special case
preprocessor directives and give them 0 indent.

diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index eb33822..95caf3a 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1820,11 +1820,14 @@ after indenting."
         (f90-indent-line-no)
       (setq no-line-number t)
       (skip-chars-forward " \t"))
-    (if (looking-at "!")
-        (setq indent (f90-comment-indent))
-      (and f90-smart-end (looking-at "end")
-           (f90-match-end))
-      (setq indent (f90-calculate-indent)))
+    (cond ((looking-at "!")
+           (setq indent (f90-comment-indent)))
+          ((looking-at "#")
+           (setq indent 0))
+          (t
+           (and f90-smart-end (looking-at "end")
+                (f90-match-end))
+           (setq indent (f90-calculate-indent))))
     (or (= indent (current-column))
         (f90-indent-to indent no-line-number))
     ;; If initial point was within line's indentation,



--- End Message ---
--- Begin Message --- Subject: Re: bug#9690: 24.0.90; f90 mode incorrectly indents top-level preprocessor directives Date: Sat, 08 Oct 2011 17:52:35 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.0.91

Thank you for the report. I fixed this in a different way.


--- End Message ---

reply via email to

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