unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Dmitry Gutov <dgutov@yandex.ru>,
	angelo.g0@libero.it, emacs-devel@gnu.org
Subject: Re: Error in C++ mode with Emacs 27.0.90
Date: Mon, 30 Mar 2020 17:49:38 +0000	[thread overview]
Message-ID: <20200330174938.GA6909@ACM> (raw)
In-Reply-To: <83ftdr5kpb.fsf@gnu.org>

Hello, Eli.

On Sun, Mar 29, 2020 at 16:56:00 +0300, Eli Zaretskii wrote:
> > Date: Sun, 29 Mar 2020 11:58:26 +0000
> > From: Alan Mackenzie <acm@muc.de>
> > Cc: emacs-devel@gnu.org

> > > Yes, it works! I tested it on master so I think it should be backported
> > > to Emacs-27

> > Thanks!

> > Is it really important enough for Emacs 27?  It only happens in a file
> > with one single function, and even then, if I understand it right, it
> > doesn't prevent the user adding another function and carrying on with his
> > work.

> > Anyhow, Eli would need to give his permission before we could add it to
> > Emacs 27.

> I might, if you make the change less different from the current code
> (the 'length > 1' vs cddr).  If the change is just an addition, then
> I'm probably okay with it.

OK, let's see!  The following patch, in place of the original patch, is
a minimal patch, although fundamentally the same as the one I first
posted here:



diff --git a/lisp/imenu.el b/lisp/imenu.el
index fb8b3de662..1949f2f48f 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -911,11 +911,15 @@ imenu-update-menubar
         (setq index-alist (imenu--split-submenus index-alist))
 	(let* ((menu (imenu--split-menu index-alist
                                         (buffer-name)))
-               (menu1 (imenu--create-keymap (car menu)
-					    (cdr (if (< 1 (length (cdr menu)))
-						     menu
-						   (car (cdr menu))))
-					    'imenu--menubar-select)))
+               (menu1 (imenu--create-keymap
+                       (car menu)
+		       (cdr (if (or (< 1 (length (cdr menu)))
+                                    ;; Have we a non-nested single entry?
+                                    (atom (cdadr menu))
+                                    (atom (cadadr menu)))
+				menu
+			      (car (cdr menu))))
+		       'imenu--menubar-select)))
 	  (setcdr imenu--menubar-keymap (cdr menu1)))))))
 
 (defun imenu--menubar-select (item)


Should I commit this to the emacs-27 release branch?

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2020-03-30 17:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 20:50 Error in C++ mode with Emacs 27.0.90 Angelo Graziosi
2020-03-27 15:56 ` Angelo Graziosi
2020-03-28 15:19   ` Alan Mackenzie
2020-03-28 17:34     ` Angelo Graziosi
2020-03-28 20:10       ` Alan Mackenzie
2020-03-28 22:31         ` Angelo Graziosi
2020-03-29 11:58           ` Alan Mackenzie
2020-03-29 13:56             ` Eli Zaretskii
2020-03-30 17:49               ` Alan Mackenzie [this message]
2020-03-30 18:36                 ` Eli Zaretskii
2020-03-30 19:46                   ` Alan Mackenzie
2020-03-28 23:18         ` Dmitry Gutov
2020-03-29 11:50           ` Alan Mackenzie
2020-03-29 22:32             ` Dmitry Gutov
2020-04-04 11:46               ` Alan Mackenzie
2020-04-04 12:52                 ` Dmitry Gutov
2023-02-18 17:52               ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200330174938.GA6909@ACM \
    --to=acm@muc.de \
    --cc=angelo.g0@libero.it \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).