From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#20778: Flush left indentation in c-mode Date: 10 Jun 2015 11:00:34 -0000 Organization: muc.de e.V. Message-ID: <20150610110034.44777.qmail@mail.muc.de> References: <5577190B.4000003@gnu.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1433934096 6147 80.91.229.3 (10 Jun 2015 11:01:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jun 2015 11:01:36 +0000 (UTC) Cc: Bruce Korb To: 20778@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 10 13:01:21 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z2dl2-0005Ph-Tw for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jun 2015 13:01:21 +0200 Original-Received: from localhost ([::1]:38871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2dl2-0007tu-2X for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jun 2015 07:01:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2dkv-0007tl-TI for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 07:01:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2dkp-00019h-Vt for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 07:01:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2dkl-0000vV-3a; Wed, 10 Jun 2015 07:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z2dkk-0006Vj-Mk; Wed, 10 Jun 2015 07:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 10 Jun 2015 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20778 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 20778-submit@debbugs.gnu.org id=B20778.143393404124989 (code B ref 20778); Wed, 10 Jun 2015 11:01:02 +0000 Original-Received: (at 20778) by debbugs.gnu.org; 10 Jun 2015 11:00:41 +0000 Original-Received: from localhost ([127.0.0.1]:46723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2dkN-0006Uy-Lq for submit@debbugs.gnu.org; Wed, 10 Jun 2015 07:00:40 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:19663) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2dkJ-0006Uo-GB for 20778@debbugs.gnu.org; Wed, 10 Jun 2015 07:00:37 -0400 Original-Received: (qmail 44778 invoked by uid 3782); 10 Jun 2015 11:00:34 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/10.1-RELEASE (amd64)) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103785 Archived-At: Hello, Bruce. In article you wrote: > With the patched cc-mode, I ran into this situation again. Er, any chance of a reference to "this situation"? Perhaps the bug number of a previous bug, or the Subject: and Date: of a pertinent email, or something like that. :-) > It seems to think that the flush-left alignment of the "if" statement is fine. > The rest of the code indents as you see here. Reloading cc-mode does no > good, it leaves the statement flush left. Closing and re-visiting the file > cleans up the confusion and re-indents correctly. > I do not know what you can do about it without better information from me, > but I don't know what to tell you either. :( Oh, the "c-file-style" is "linux". OK, standard information, please: (i) The Emacs version number (M-x emacs-version). (ii) The CC Mode version (M-x c-version). (iii) Have you got any CC Mode customisations in your .emacs? You've already said you're in style "linux", but is there anything else? If so, what? (iii) The EXACT steps you took between starting Emacs to seeing the error, detailed enough that I can reproduce it. (iv) What exactly do you mean "It seems to think that the flush-left alignment ... is fine"? What command did you give that led you to this conclusion, or what output from CC Mode was relevant? Just for info, when I loaded the following fragment into Emacs, stripped of the leading "> " from each line, set the style "linux", then indented it (by indenting the first two lines using , then placing point at the opening "{" and doing C-M-q), the indentation was fine. I can't reproduce the problem at the moment. >> void ftl_ns_print(void) >> { >> #if MAX_EVENT_EVT_PRIORITY >= LOG_DEBUG >> int skip_ct = 0; >> >> for (int i = 0; i < s_ns_table.nst_count; i++) { >> struct ftl_ns_t * const ns_p = &s_ns_table.nst_ns_list[i]; >> >> if (ns_p->active_ns_id == NS_ID_NULL) { >> skip_ct++; >> continue; >> } >> >> EMIT_PRINT_NS_EVENT( >> debug, "ns_id=%d, flags=%u, active_ns_id=%d, parent_ns_id=%d, next_snapshot_ns_id=%d, " >> "snapshot_sn=%u, size_byte=%lu, used_bytes=%lu, physical_used_bytes=%lu, max_lpn=%lu, " >> "creation_io_id=%lu, snapshot_sn_seq=%u\n", >> sint32, ns_p->ns_id, >> uint32, ns_p->flags, >> sint32, ns_p->active_ns_id, >> sint32, ns_p->parent_ns_id, >> sint32, ns_p->next_snapshot_ns_id, >> uint32, ns_p->snapshot_sn, >> uint64, ns_p->size_bytes, >> uint64, ns_p->used_bytes, >> uint64, ns_p->physical_used_bytes, >> uint64, ns_p->max_lpn, >> uint64, ns_p->creation_io_id, >> uint32, ns_p->snapshot_sn_seq >> ); >> } >> >> if (skip_ct > 0) >> EMIT_SKIPPED_NS_EVENT(debug, "skipped %d empty name spaces", sint32, skip_ct); >> #endif >> } -- Alan Mackenzie (Nuremberg, Germany).