From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.devel Subject: Re: Calling C++ hackers. Please try out the new handling of C++11 lambda functions in CC Mode. Date: Wed, 24 Aug 2016 22:10:32 +0100 Message-ID: References: <20160815122412.GA4515@acm.fritz.box> <1471643100.1410.3.camel@gmail.com> <20160820151955.GB2529@acm.fritz.box> <1471730790.1410.16.camel@gmail.com> <20160821162204.GB3813@acm.fritz.box> <20160824194352.GD4920@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1472073107 22703 195.159.176.226 (24 Aug 2016 21:11:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Aug 2016 21:11:47 +0000 (UTC) Cc: Matthias Meulien , Emacs Development To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 24 23:11:43 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcfSY-0005WB-MG for ged-emacs-devel@m.gmane.org; Wed, 24 Aug 2016 23:11:42 +0200 Original-Received: from localhost ([::1]:53375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcfSV-0005On-Lh for ged-emacs-devel@m.gmane.org; Wed, 24 Aug 2016 17:11:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcfRy-0005OW-Uq for emacs-devel@gnu.org; Wed, 24 Aug 2016 17:11:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcfRw-0002re-1q for emacs-devel@gnu.org; Wed, 24 Aug 2016 17:11:06 -0400 Original-Received: from mail-ua0-x235.google.com ([2607:f8b0:400c:c08::235]:36650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcfRv-0002rZ-Sw for emacs-devel@gnu.org; Wed, 24 Aug 2016 17:11:03 -0400 Original-Received: by mail-ua0-x235.google.com with SMTP id m60so11025476uam.3 for ; Wed, 24 Aug 2016 14:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0YigDWM0v8BBsdPyEecK19ua+p/gwPyjhl6l4pDPMi4=; b=OyQ5tmql6SLopgwZhXpyUJndMkvMV1LkVIdjW0Dt48YYMAk07tkCQ4ilthvcKEoc4b 2blKLYsaFrk8eKcIa1yFpN1ywf3Zg7jF86Q3V48/xCXv9p1uMv0kSobgKTYIjJd9yH71 Sz/3OzL7WblBUCZ7N7KVJrvRFou7vr9U3u7FJfqZXCSmcc8aaW4WGwvptZqOfZETiMUq wqYZRFN5QEPG8C7vdrGz3zyZpnrudor+RCCVhZ4B5eA18HK8LEZDptQDfMQrgE7T72lJ EKeDFCuoUSdbrFqXCK5dW8xZkGlb1HW6Ss6jH89X+/pS5FhenAGrgGOZ2BopqFbNakFs gb2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0YigDWM0v8BBsdPyEecK19ua+p/gwPyjhl6l4pDPMi4=; b=K/Yqq+hlT07b1CDkcAEsVmO29rhKDcBABGyeZYJJ9w7GFNkTmiIR4jB2pvB38d390N 0pvYbYK0+bXB0p7HNdixgncSwQ+0MZKB7Fm+vng7fi6qtRZovVXGHGTg5CB3hG94MDME NK9hpKCDSP/wHLqzEUoQkc4o3coNSXM7vaxEERMgFZL8/bpGso/l9XHo1zxX06r5PQUy A/FytQKTX5JXn/Olx5tXDBz/Dk9Bh6dTyQLpY1zryhsl7r/JzXkNKySC5p/CGpzwg4Us XvVsxE0SrwmLHI/LsCTm6rPXyemZcYP1Acn1IGZzNxc8Td+bmTJkBlKecx9sB7LO6ryH iTtA== X-Gm-Message-State: AEkooutm7Z4cciqzYeukhEcHlanm3oaHHlow6QBzDnBQf7dMmg+FtInrcZip28s6emDRXb5861lZtbhrwQvC0g== X-Received: by 10.31.217.130 with SMTP id q124mr2434393vkg.136.1472073063354; Wed, 24 Aug 2016 14:11:03 -0700 (PDT) Original-Received: by 10.176.1.111 with HTTP; Wed, 24 Aug 2016 14:10:32 -0700 (PDT) In-Reply-To: <20160824194352.GD4920@acm.fritz.box> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c08::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206787 Archived-At: On 24 August 2016 at 20:43, Alan Mackenzie wrote: > Hello, Richard. > > On Wed, Aug 24, 2016 at 08:27:58PM +0100, Richard Copley wrote: >> Hi Alan, > >> Thanks for this! > >> I encountered a problem while trying to come up with an >> example so I could suggest a different default indentation >> style for lambda bodies: > >> int main () >> { >> std::cout << ([] (int x) -> int { >> return 2 * x; >> } (10)) << std::endl; >> } > >> Never mind the default indentation style, life's too short! >> But here is the problem I mentioned. I just pulled from master >> and recompiled and the bug is still present (as of your >> commit 799a8a3338389013e8a76a70f507664ccb09a14f). > >> >>From emacs -Q: > >> C-x b x RET ; switch to a new buffer >> M-x c++-mode RET >> { } C-p ; insert a pair of braces and put point between them >> [ ; insert a left square bracket > >> Emacs freezes. It can be woken up by holding down C-g >> for a few seconds, at which point the *Messages* >> buffer has this: > >> Error during redisplay: (jit-lock-function 55) signaled (quit) >> Error during redisplay: (jit-lock-function 57) signaled (quit) >> Error during redisplay: (jit-lock-function 60) signaled (quit) >> Quit [7 times] > > Thanks for taking the trouble to report this. What appears to be the > same problem was reported by Yakov Markovitch on the CC Mode list > yesterday evening. I've investigated this and prepared a putative fix. > > That fix is in the patch below. Could you please apply the patch, > recompile CC Mode and try it out in normal C++ code, then let me know (a > second opinion besides Yakov's) whether it fixes the problem completely. > > Thanks! At the moment, I'm trying to get everything tidied up to > release CC Mode 5.33, and I'm hoping that this is the _last_ "last > minute" bug. > > > > diff -r f3c92d9e3424 cc-fonts.el > --- a/cc-fonts.el Sun Aug 21 15:17:45 2016 +0000 > +++ b/cc-fonts.el Tue Aug 23 20:36:35 2016 +0000 > @@ -1654,7 +1654,7 @@ > (c-backward-token-2))) > > ;; Go round the following loop once per captured item. > - (while (and (not (eq (char-after) ?\])) > + (while (and (not (looking-at "\\s)")) > (< (point) limit)) > (if (eq (char-after) ?&) > (progn (setq mode ?&) > @@ -1703,7 +1703,7 @@ > (c-forward-syntactic-ws))) > > (setq capture-default nil) > - (forward-char)))) ; over the terminating "]". > + (forward-char)))) ; over the terminating "]" or whatever. > nil) > > > > -- > Alan Mackenzie (Nuremberg, Germany). Great, thank you. I didn't have time to test much, but I haven't noticed any problems with the patch installed. Couldn't reproduce the problem I was talking about.