Stephen Leake <[email protected]> writes: > Simon Wright <[email protected]> writes: > >> As far as I can see the current code is >> >> indent := indentation of previous keyword; >> prev-indent := nil; >> next-indent := nil; >> if ada-indent-comment-gnat then >> if indent is a multiple of ada-indent >> then >> indent := indent; >> else >> indent previous line; >> prev-indent := indentation-of-previous-line; >> if indent = prev-indent >> then >> indent := indent; >> else >> indent next line; >> next-indent := indentation-of-next-line; >> if indent = next-indent >> then >> indent := indent; >> else >> if prev-indent /= nil or next-indent /= nil then >> indent := floor (indent, ada-indent); >> end if; >> end if; >> end if; >> end if; >> else >> indent := indent; >> end if; >> >> which has several problems. >> >> First, the initial calculated value of indent is almost bound to be a >> multiple of ada-indent, so most of the rest of the code won't have any >> effect. I don't think this check is actually necessary? (removing it >> doesn't seem to make any difference).
I think I misunderstood your comment here. This check allows comments that are not aligned with either the previous or following line, but are a multiple of ada-indent. It is currently the case that the rest of the indentation code will never produce such an indent for a comment, and in that sense this is dead code (_unless_ the user overrides the auto indentation!). But I would not want such a fragile coupling hidden in the code. -- -- Stephe _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
