[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error in C++ mode with Emacs 27.0.90
From: |
Alan Mackenzie |
Subject: |
Re: Error in C++ mode with Emacs 27.0.90 |
Date: |
Sat, 28 Mar 2020 15:19:44 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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 #<marker at 1 in foobar.cpp>)
> > 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)
- Error in C++ mode with Emacs 27.0.90, Angelo Graziosi, 2020/03/24
- Re: Error in C++ mode with Emacs 27.0.90, Angelo Graziosi, 2020/03/27
- Re: Error in C++ mode with Emacs 27.0.90,
Alan Mackenzie <=
- Re: Error in C++ mode with Emacs 27.0.90, Angelo Graziosi, 2020/03/28
- Re: Error in C++ mode with Emacs 27.0.90, Alan Mackenzie, 2020/03/28
- Re: Error in C++ mode with Emacs 27.0.90, Angelo Graziosi, 2020/03/28
- Re: Error in C++ mode with Emacs 27.0.90, Alan Mackenzie, 2020/03/29
- Re: Error in C++ mode with Emacs 27.0.90, Eli Zaretskii, 2020/03/29
- Re: Error in C++ mode with Emacs 27.0.90, Alan Mackenzie, 2020/03/30
- Re: Error in C++ mode with Emacs 27.0.90, Eli Zaretskii, 2020/03/30
- Re: Error in C++ mode with Emacs 27.0.90, Alan Mackenzie, 2020/03/30
- Re: Error in C++ mode with Emacs 27.0.90, Dmitry Gutov, 2020/03/28
- Re: Error in C++ mode with Emacs 27.0.90, Alan Mackenzie, 2020/03/29