Subject: bug#78935: 30.1.90; [PATCH] Let Imenu optionally allow duplicate menu entries

From: Eli Zaretskii <[email-masked]>
Date: Sat, 05 Jul 2025 11:59:34 +0300

> Date: Fri, 4 Jul 2025 16:46:21 +0000
> From:  Drew Adams via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Attached is a slightly better patch.  The option is
> tested at the level of the mapcar, not within the
> function arg to mapcar.
> 
> Also, the doc string of the new option mentions that
> the option applies only to a Imenu menu, not also to
> the use of command `imenu', which uses `completing-read'.

Thanks.

> +(defcustom imenu-allow-duplicate-menu-items-flag t
> +  "Non-nil means that Imenu can include duplicate menu items.
> +For example, if the buffer contains multiple definitions of function
> +`foo' then a menu item is included for each of them.
> +Otherwise, only the first such definition is accessible from the menu.
> +
> +This option applies only to an Imenu menu, not also to the use of
> +command `imenu', which uses `completing-read' to read a menu item.
> +The use of that command doesn't allow duplicate items."
> +  :type 'boolean :group 'imenu)

Please add a suitable :version tag.

Also, this new user option should be called out in NEWS.