Piotr Trojanek <[email protected]> writes: > this time I read the ada-mode manual, set ada-indent-comment-gnat to > t, but still I am confused by the results. > > On the attached code would I expect ada-mode indentation to keep the > comment where it is. However, it reindents it with the preceding null.
> procedure GNAT_Comment_Indent is > begin > if True then > null; > -- some comment indented with ELSE > else > null; > end if; > end; The definition of ada-indent-comment-gnat is: If non-nil, comments are indented to meet the GNAT comment style check. That is, one of: - multiple of ada-indent - next non-blank line - previous non-blank line This seems to imply an order in the three conditions, but it doesn't; as long as the comment meets _any_ of the three conditions, it passes the GNAT check. When computing the indentation, the code checks them in this order: - multiple of ada-indent - previous non-blank line - next non-blank line Is that the source of your confusion? It would make sense to make the definition order match the code order. It would also make sense to match the behavior of GPS; I don't currently have that installed to check. -- -- Stephe _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
