From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Error in C++ mode with Emacs 27.0.90 Date: Sat, 28 Mar 2020 15:19:44 +0000 Message-ID: <20200328151944.GF7449@ACM> References: <1385091004.1458082.1585083014184@mail1.libero.it> <2124649786.1598258.1585324562989@mail1.libero.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74463"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Angelo Graziosi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 28 16:20:42 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIDGL-000JHG-4d for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Mar 2020 16:20:41 +0100 Original-Received: from localhost ([::1]:53960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIDGK-0006Pp-7W for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Mar 2020 11:20:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39087) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIDFY-0005iB-Do for emacs-devel@gnu.org; Sat, 28 Mar 2020 11:19:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIDFW-0007Ki-Gy for emacs-devel@gnu.org; Sat, 28 Mar 2020 11:19:52 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:18997 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1jIDFU-0007FS-Vh for emacs-devel@gnu.org; Sat, 28 Mar 2020 11:19:50 -0400 Original-Received: (qmail 16711 invoked by uid 3782); 28 Mar 2020 15:19:46 -0000 Original-Received: from acm.muc.de (p2E5D54D7.dip0.t-ipconnect.de [46.93.84.215]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 28 Mar 2020 16:19:43 +0100 Original-Received: (qmail 7773 invoked by uid 1000); 28 Mar 2020 15:19:44 -0000 Content-Disposition: inline In-Reply-To: <2124649786.1598258.1585324562989@mail1.libero.it> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245881 Archived-At: Hello, Angelo. On Fri, Mar 27, 2020 at 16:56:02 +0100, Angelo Graziosi wrote: > > Il 24 marzo 2020 alle 21.50 Angelo Graziosi ha scritto: > > I found an error with C++ mode which I can reproduce with this init.el: > > ------------------------------------------- > > $ cat init.el > > ;; C/C++ modes > > (defun my-c-mode () > > "My customization for `c-mode' and `c++-mode'." > > (interactive) > > ;; No indent for open bracket > > (c-set-offset 'substatement-open 0) > > ;; Add index of func. to menu bar > > (imenu-add-to-menubar "Functions") > > ) > > ;; c++-mode > > (add-hook 'c++-mode-hook 'my-c-mode) > > (setq imenu-auto-rescan t) > > ;; The default is 60000 > > (setq imenu-auto-rescan-maxout 500000) > > ;; Show in which function is the cursor > > (which-function-mode 1) > > ------------------------------------------- > > (maybe it can be reduced...) and this test case: > > ----------------------------------- > > $ cat foobar.cpp > > int main() > > { > > return 0; > > } > > ----------------------------------- > > When I visit it with C-x C-f, I get this error in minibuffer: > > Error in menu-bar-update-hook (imenu-update-menubar): (wrong-type-argument sequencep #) > > The error disappears if I add a space before 'int main()', i.e. with ' int main()' > > I have seen that both on GNU/Linux and Windows builds of 27.0.90. > Both Emacs 27 branch and master are affected by this issue. I've had a look into this, and it seems that imenu and CC Mode disagree about the correct format for an imenu alist when there's only one element in it. The function where things go wrong is imenu-update-menubar, in the "else" branch of the single `if' form in the function. I hope to have time soon to look into this more thoroughly, assuming nobody else does first. ;-) > > Ciao, > > Angelo. -- Alan Mackenzie (Nuremberg, Germany)