Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!GRANITE.CR.BULL.COM!Mandel From: Mandel@GRANITE.CR.BULL.COM ("Mark A. Mandel") Newsgroups: gnu.emacs.bug Subject: for-loop indentation after cast at left margin Message-ID: <8909141113.aa01626@granite.cr.bull.com> Date: 14 Sep 89 15:13:20 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: Bull Worldwide Information Systems Lines: 39 In GNU Emacs C-mode, there is an indentation error in the following situation: (void)strcpy(whoami, *argv++ ); for (i = 0; i < r; i++) x[r] = i; (The details of the loop control and contents are irrelevant.) I have indented the loop contents correctly. But C-mode indents it like this: (void)strcpy(whoami, *argv++ ); for (i = 0; i < r; i++) x[r] = i; If the loop contents are enclosed in braces, indentation is correct. If the cast of the function is removed, or if it is indented at all, indentation is correct. But after a function cast beginning in the left margin, unbraced (one-statement) for-loops are incorrectly indented. The loop need not be directly after the cast for this effect to occur: its effects extend indefinitely, even beyond the scope of the main(){...} that encloses the cast. The scope of the bug may be wider than I have described, but this is what I have observed. Reference (version info, extracted from "news of recent Emacs changes"): GNU Emacs NEWS -- history of user-visible changes. 17-Aug-1988 Copyright (C) 1988 Free Software Foundation, Inc. Changes in version 18.52. -- Mark Mandel Bull Worldwide Information Systems 300 Concord Rd., m/s 826A Billerica, Mass. 01821 (508) 671-3387 Mandel@granite.cr.bull.com /* My employer is not responsible for anything I say, do, think, or eat. */