Subject: Re: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode

From: Leo <[email-masked]>
Date: Thu, 05 Apr 2012 19:18:59 +0800

On 2012-04-05 00:18 +0800, Stefan Monnier wrote:
> That's partly normal: objc-mode is not in `which-func-modes'.
> But if you add `objc-mode' to which-func-modes, indeed the function name
> still doesn't show up in the mode-line (whereas it did in Emacs-23, so
> this is a regression).
>
>> Also, M-x imenu-add-menubar-index says: Error in
>> menu-bar-update-hook (imenu-update-menubar): (wrong-type-argument
>> integerp nil)
>
> I can indeed reproduce it (I used the src/nsfont.m file as sample ObjC file).
>
> Hopefully Alan can figure it out

It seems the bug was brought in by commit

------------------------------------------------------------
revno: 105590
committer: Alan Mackenzie <[email-masked]>
branch nick: trunk
timestamp: Sat 2011-08-27 08:41:23 +0000
message:
  progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it handle
  function pointer parameters properly.

which increases the number of grouped matches by 1 and the sad fact that
cc-imenu-objc-generic-expression-*-index dependent on that.

BTW, the warning

,----
| ;;                        *Warning for cc-mode developers*
| ;;
| ;; `cc-imenu-objc-generic-expression' elements depend on
| ....
`----

should be placed in front of cc-imenu-c++-generic-expression to be of
any use.

Leo