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#5570: Emacs 23.1.91.1 C++ mode "ESC C-q" and TAB indenting issue. Date: Wed, 17 Feb 2010 09:46:52 +0000 Message-ID: <20100217094652.GC2392@muc.de> References: <000301caac36$0fc0b760$2f422620$@net> <87pr494md5.fsf@stupidchicken.com> <000e01caad1e$dcbfc560$963f5020$@net> <876360s8rw.fsf@stupidchicken.com> <20100214201006.GA6169@muc.de> <000001caae62$638af6c0$2aa0e440$@net> <20100216163923.GB3456@muc.de> <000301caaf36$d5f86100$81e92300$@net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1266400534 21983 80.91.229.12 (17 Feb 2010 09:55:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Feb 2010 09:55:34 +0000 (UTC) Cc: 'Chong Yidong' , 5570@debbugs.gnu.org To: Bob Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 17 10:55:31 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nhgd0-0007zl-NV for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Feb 2010 10:55:31 +0100 Original-Received: from localhost ([127.0.0.1]:53319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nhgd0-0007Px-Ac for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Feb 2010 04:55:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhgaR-0006Vy-Ic for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 04:52:51 -0500 Original-Received: from [140.186.70.92] (port=45999 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhgaO-0006V8-9u for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 04:52:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NhgaN-0000Yc-4y for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 04:52:48 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46350) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NhgaN-0000YY-3I for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 04:52:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NhgO3-0000Vs-NQ; Wed, 17 Feb 2010 04:40:03 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Feb 2010 09:40:03 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5570 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Original-Received: via spool by 5570-submit@debbugs.gnu.org id=B5570.12663995821953 (code B ref 5570); Wed, 17 Feb 2010 09:40:03 +0000 Original-Received: (at 5570) by debbugs.gnu.org; 17 Feb 2010 09:39:42 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NhgNi-0000VS-Fv for submit@debbugs.gnu.org; Wed, 17 Feb 2010 04:39:42 -0500 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NhgNg-0000VL-63 for 5570@debbugs.gnu.org; Wed, 17 Feb 2010 04:39:41 -0500 Original-Received: (qmail 24226 invoked by uid 3782); 17 Feb 2010 09:39:36 -0000 Original-Received: from acm.muc.de (pD9E22D47.dip.t-dialin.net [217.226.45.71]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 17 Feb 2010 10:39:35 +0100 Original-Received: (qmail 3273 invoked by uid 1000); 17 Feb 2010 09:46:52 -0000 Content-Disposition: inline In-Reply-To: <000301caaf36$d5f86100$81e92300$@net> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 17 Feb 2010 04:40:03 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35147 Archived-At: Hi, Bob, On Tue, Feb 16, 2010 at 10:35:37AM -0800, Bob wrote: > Alan, > >> I am now attempting to try your c-state-cache-init and find this is not > >> defined. > >That's exactly > > M-: (c-state-cache-init) > Ahh, typed it in wrong. I have been saving the buffer where the " > SelectInternalConvertableToVectorType" snippet is with the problematic '{' > in column 0. > So I am now able to eval your "(c-state-cache-init)" in the buffer. > The result is no difference, '{' still appears in column 0 when I TAB. > *Messages* > contains "1 (#o1, #x1)" after running it, if that means anything to you. Yes, thanks. The "1 .." is just random noise. The fact that `c-state-cache-init' fixes nothing tells me that the bug's not to do with a massive overhaul of the "state cache" (a cache of brace/paren/bracket positions) I committed several months ago. > With regard to being more specific about what I type, that's going to be > really difficult. OK, I understand that. > Typically, I do a lot of kill - yanks, keyboard entry, and often return > to text to post-insert missing ','s or '>'s and then TAB or C-q C-j. > That's when I discover a bad indentation case. Sometimes, by TAB-ing on > previous lines then returning to the problematic line, the indentation > corrects. I have done what you did with the snippet also - put it into > a separate file, start a separate emacs session. Each time I do that, > the indentation corrects ('{' is not in col 0) and doesn't get out of > whack as I fiddle in it. Makes me think the problem occurs with more > than 1 file visited. I have a hyptothesis: noramlly, when you type in a < or > which "looks like" a template delimiter, CC Mode marks it as an openining/closing parenthesis. These can, and do, get confused with "proper" parens, { } ( ) [ ], sometimes. It seems likely that on certain deletions, these marked s become unbalanced, and this confuses the indentation. I committed a fix for this on 2010-02-04, barely 2 weeks ago. This fix ensures that these marks only get applied to < and > in balanced pairs, and when stuff is deleted does the Right Thing. The fix hasn't yet found its way into a pretest. If you test on the bzr head, could you try it out, please. Otherwise, please be patient and try it out on the NEXT pretest version, when that gets released. > I am preserving the emacs session with the bad '{' indentation (col 0). > Is there any way we can narrow the issue by probing the buffer, such as > with your (c-state-cache-init) ? Could you perhaps test the above hypothesis, please? Turn on `show-paren-mode'. When you next hit this bad state in a buffer, place point on a < or >, and see if it mismatches with a proper paren/brace. > Attached is the "c-submit-bug-report" run from the problematic buffer. Much appreciated. > Bob -- Alan Mackenzie (Nuremberg, Germany).