From unknown Wed Jun 25 00:23:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Apr 2012 02:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11142 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 11142@debbugs.gnu.org Cc: bug-cc-mode@gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: bug-cc-mode@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.133324775625145 (code B ref -1); Sun, 01 Apr 2012 02:36:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Apr 2012 02:35:56 +0000 Received: from localhost ([127.0.0.1]:33450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEAe3-0006XW-N2 for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59065) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEAdp-0006XD-86 for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEAdg-0004ka-7W for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEAdg-0004kW-2W for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEAde-0002Qe-I1 for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 22:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEAdb-0004kE-P1 for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 22:35:29 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:57343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEAdb-0004k5-IN for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 22:35:27 -0400 Received: by iajr24 with SMTP id r24so3300547iaj.0 for ; Sat, 31 Mar 2012 19:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:x-debbugs-cc:date:message-id:mime-version :content-type; bh=lB+84W2a0tNF5uWKZeXC8VaTrbrolAuvcTban9bPQzc=; b=xSoINCe+4fiRpEkUHf9++77DCfRjMDDEfATYeqJxpxGLHQ7qcPTAEbujpD6lAEGogt fvmnKUq54aXogz3HPgoSodTAIe1XX/GCllo8TA6sUmlxzeHhdjiJrv7CXcnGFKbwGj4a NehkYFP6pRiC/8jtlSPOSwopnmPiQe5A5KFUxpUepd7yGEp6JBFalJjnf02ZLxevFbmV E+RjZeCvPB814Almx8Qchsertf5zvj9DxghNwPHtsEGxXCY4ei4AilmtZB2bSfdbWXUS r3H1k4mGtp5Jc4Ro4R/y7i8zdMfUzGT0jtPO46FLbogkd+O4Y6mt6Jsls5EqMbsFxTjv hWsA== Received: by 10.50.106.200 with SMTP id gw8mr2784089igb.10.1333247725637; Sat, 31 Mar 2012 19:35:25 -0700 (PDT) Received: from Shidais-iMac.local ([119.255.41.67]) by mx.google.com with ESMTPS id cw5sm5279079igc.17.2012.03.31.19.35.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 31 Mar 2012 19:35:25 -0700 (PDT) From: Leo Date: Sun, 01 Apr 2012 10:34:48 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Turn on which-function-mode and open an objc file, it cannot show the function name. Also, M-x imenu-add-menubar-index says: Error in menu-bar-update-hook (imenu-update-menubar): (wrong-type-argument integerp nil) Leo From unknown Wed Jun 25 00:23:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 04 Apr 2012 16:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11142 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Leo Cc: 11142@debbugs.gnu.org X-Debbugs-Original-Cc: bug-cc-mode@gnu.org, 11142@debbugs.gnu.org Received: via spool by 11142-submit@debbugs.gnu.org id=B11142.133355638123565 (code B ref 11142); Wed, 04 Apr 2012 16:20:03 +0000 Received: (at 11142) by debbugs.gnu.org; 4 Apr 2012 16:19:41 +0000 Received: from localhost ([127.0.0.1]:40112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SFSvs-000682-Od for submit@debbugs.gnu.org; Wed, 04 Apr 2012 12:19:41 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:60583) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SFSvj-00067k-PL for 11142@debbugs.gnu.org; Wed, 04 Apr 2012 12:19:39 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AigFAKU/KE9FpZV7/2dsb2JhbACBX5xHNHmIcJ4ZhhkEmxmECQ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="172109996" Received: from 69-165-149-123.dsl.teksavvy.com (HELO pastel.home) ([69.165.149.123]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Apr 2012 12:18:59 -0400 Received: by pastel.home (Postfix, from userid 20848) id 60AED59339; Wed, 4 Apr 2012 12:18:59 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Wed, 04 Apr 2012 12:18:59 -0400 In-Reply-To: (Leo's message of "Sun, 01 Apr 2012 10:34:48 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Turn on which-function-mode and open an objc file, it cannot show the > function name. 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 Stefan The imenu error has the following backtrace: Debugger entered--Lisp error: (wrong-type-argument integerp nil) match-beginning(nil) (funcall func (match-beginning langnum) (match-end langnum)) (setq str (funcall func (match-beginning langnum) (match-end langnum))) (while (re-search-backward cc-imenu-objc-generic-expression nil t) (setq = langnum (if (match-beginning OBJC) OBJC (cond ((match-beginning Cproto) Cpr= oto) ((match-beginning Cgeneralfunc) Cgeneralfunc) ((match-beginning Cnoret= urn) Cnoreturn)))) (setq str (funcall func (match-beginning langnum) (match= -end langnum))) (cond ((not (eq langnum OBJC)) (setq clist (cons (cons str = (match-beginning langnum)) clist))) ((eq (aref str 0) 45) (setq str (concat= "-" (cc-imenu-objc-method-to-selector str))) (setq methodlist (cons (cons = str (match-beginning langnum)) methodlist))) ((eq (aref str 0) 43) (setq st= r (concat "+" (cc-imenu-objc-method-to-selector str))) (setq methodlist (co= ns (cons str (match-beginning langnum)) methodlist))) ((eq (aref str 0) 64)= (setq classcount (1+ classcount)) (cond ((and (> (length str) implen) (str= ing=3D (substring str 0 implen) "@implementation")) (setq str (substring st= r implen) str2 "@implementation")) ((string=3D (substring str 0 intflen) "@= interface") (setq str (substring str intflen) str2 "@interface")) ((string= =3D (substring str 0 prtlen) "@protocol") (setq str (substring str prtlen) = str2 "@protocol"))) (setq str (cc-imenu-objc-remove-white-space str)) (setq= methodlist (cons (cons str2 (match-beginning langnum)) methodlist)) (setq = toplist (cons nil (cons (cons str methodlist) toplist)) methodlist nil)))) (let (methodlist clist (OBJC cc-imenu-objc-generic-expression-objc-base-i= ndex) (Cnoreturn cc-imenu-objc-generic-expression-noreturn-index) (Cgeneral= func cc-imenu-objc-generic-expression-general-func-index) (Cproto cc-imenu-= objc-generic-expression-proto-index) langnum (classcount 0) toplist str str= 2 (intflen (length "@interface")) (implen (length "@implementation")) (prtl= en (length "@protocol")) (func (if (fboundp (quote buffer-substring-no-prop= erties)) (quote buffer-substring-no-properties) (quote buffer-substring))))= (goto-char (point-max)) (while (re-search-backward cc-imenu-objc-generic-e= xpression nil t) (setq langnum (if (match-beginning OBJC) OBJC (cond ((matc= h-beginning Cproto) Cproto) ((match-beginning Cgeneralfunc) Cgeneralfunc) (= (match-beginning Cnoreturn) Cnoreturn)))) (setq str (funcall func (match-be= ginning langnum) (match-end langnum))) (cond ((not (eq langnum OBJC)) (setq= clist (cons (cons str (match-beginning langnum)) clist))) ((eq (aref str 0= ) 45) (setq str (concat "-" (cc-imenu-objc-method-to-selector str))) (setq = methodlist (cons (cons str (match-beginning langnum)) methodlist))) ((eq (a= ref str 0) 43) (setq str (concat "+" (cc-imenu-objc-method-to-selector str)= )) (setq methodlist (cons (cons str (match-beginning langnum)) methodlist))= ) ((eq (aref str 0) 64) (setq classcount (1+ classcount)) (cond ((and (> ..= . implen) (string=3D ... "@implementation")) (setq str (substring str imple= n) str2 "@implementation")) ((string=3D (substring str 0 intflen) "@interfa= ce") (setq str (substring str intflen) str2 "@interface")) ((string=3D (sub= string str 0 prtlen) "@protocol") (setq str (substring str prtlen) str2 "@p= rotocol"))) (setq str (cc-imenu-objc-remove-white-space str)) (setq methodl= ist (cons (cons str2 (match-beginning langnum)) methodlist)) (setq toplist = (cons nil (cons (cons str methodlist) toplist)) methodlist nil)))) (if (eq = (car toplist) nil) (setq toplist (cdr toplist))) (if (< classcount 2) (let = ((classname (car (car toplist))) (p (cdr (car (cdr ...)))) last) (setq topl= ist (cons (cons classname p) (cdr (cdr (car toplist))))) (if clist (progn (= setq last toplist) (while (cdr last) (setq last (cdr last))) (setcdr last c= list)))) (if clist (setq toplist (cons (cons "C" clist) toplist)))) toplist) cc-imenu-objc-function() imenu--make-index-alist(t) imenu-update-menubar() eval((imenu-update-menubar) nil) eval-expression((imenu-update-menubar) nil) call-interactively(eval-expression nil nil) From unknown Wed Jun 25 00:23:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 05 Apr 2012 11:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11142 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Stefan Monnier Cc: 11142@debbugs.gnu.org X-Debbugs-Original-Cc: bug-cc-mode@gnu.org, 11142@debbugs.gnu.org Received: via spool by 11142-submit@debbugs.gnu.org id=B11142.133362483725798 (code B ref 11142); Thu, 05 Apr 2012 11:21:02 +0000 Received: (at 11142) by debbugs.gnu.org; 5 Apr 2012 11:20:37 +0000 Received: from localhost ([127.0.0.1]:40866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SFkk0-0006i1-5k for submit@debbugs.gnu.org; Thu, 05 Apr 2012 07:20:37 -0400 Received: from mail-iy0-f172.google.com ([209.85.210.172]:45770) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SFkjv-0006hb-5P for 11142@debbugs.gnu.org; Thu, 05 Apr 2012 07:20:34 -0400 Received: by iazz13 with SMTP id z13so1562022iaz.3 for <11142@debbugs.gnu.org>; Thu, 05 Apr 2012 04:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:face:date :message-id:mime-version:content-type; bh=pPlkFDTSBOlw5+M1/6Afat7kcCHMuXfMoe9esE9wCvk=; b=Eisbsj42K/tHo5o92ZS+svbiUR3Hainwz5Tuw1dGAAyM+GWvS3NYG3Vxpt3zS158J3 oku7BIz3Ro4gTuOkcg0xdUDQubV3gHU3U0ec2x7CL7lAcr4kVDwj60k3+5j++TcplA8u w+gARYIvhaok8Q5aFUoi0vmdF+58hrsHkksef3tFFaEckqwLxmT8Kjy343jX+Xa5wNl9 U8LlG3dBBFepjA4SAbdWU59KnKGKnJ2eZzLqjNHGFVTYiOQL907TYG6/OYLcQDsbYC1N NRT1butIjKjEHtcoRrvsVvkbi6hSwH/XB21XnbWRLLcxLd7I+XyP0sZFE8vGkHYsosx0 jpxQ== Received: by 10.50.57.129 with SMTP id i1mr1403179igq.33.1333624796665; Thu, 05 Apr 2012 04:19:56 -0700 (PDT) Received: from Victoria.local ([114.247.10.71]) by mx.google.com with ESMTPS id vr4sm15570948igb.1.2012.04.05.04.19.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Apr 2012 04:19:54 -0700 (PDT) From: Leo In-Reply-To: (Stefan Monnier's message of "Wed, 04 Apr 2012 12:18:59 -0400") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (Mac OS X 10.6.8) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= Date: Thu, 05 Apr 2012 19:18:59 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.8 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.8 (-) 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 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 From unknown Wed Jun 25 00:23:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 06 Apr 2012 17:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11142 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Leo Cc: Stefan Monnier , 11142@debbugs.gnu.org Received: via spool by 11142-submit@debbugs.gnu.org id=B11142.133373245128908 (code B ref 11142); Fri, 06 Apr 2012 17:15:02 +0000 Received: (at 11142) by debbugs.gnu.org; 6 Apr 2012 17:14:11 +0000 Received: from localhost ([127.0.0.1]:42812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SGCji-0007WD-KP for submit@debbugs.gnu.org; Fri, 06 Apr 2012 13:14:10 -0400 Received: from colin.muc.de ([193.149.48.1]:42076 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SGCjg-0007W3-Na for 11142@debbugs.gnu.org; Fri, 06 Apr 2012 13:14:10 -0400 Received: (qmail 22801 invoked by uid 3782); 6 Apr 2012 17:13:26 -0000 Received: from acm.muc.de (pD951A7BF.dip.t-dialin.net [217.81.167.191]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 06 Apr 2012 19:13:22 +0200 Received: (qmail 3120 invoked by uid 1000); 6 Apr 2012 17:11:54 -0000 Date: Fri, 6 Apr 2012 17:11:54 +0000 Message-ID: <20120406171154.GA3085@acm.acm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hi, Leo. On Thu, Apr 05, 2012 at 07:18:59PM +0800, Leo wrote: > 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 > 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. Brilliant diagnosis, absolutely right! Thanks. There're some pretty non-standard coding techniques in that file. ;-) Here's the final bit of the fix; please try it out if you haven't done already, and let me know whether it works fully. > 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. Yes indeed. > Leo diff -r 4b03c7ef6cf2 cc-menus.el --- a/cc-menus.el Tue Apr 03 20:57:45 2012 +0000 +++ b/cc-menus.el Fri Apr 06 17:03:33 2012 +0000 @@ -223,7 +223,7 @@ "\\|" ;; > General function name regexp ;; Pick a token by (match-string 3) - (car (cdr (nth 2 cc-imenu-c++-generic-expression))) ; -> index += 5 + (car (cdr (nth 2 cc-imenu-c++-generic-expression))) ; -> index += 6 (prog2 (setq cc-imenu-objc-generic-expression-general-func-index 3) "") ;; > Special case for definitions using phony prototype macros like: ;; > `int main _PROTO( (int argc,char *argv[]) )'. @@ -232,11 +232,11 @@ (concat "\\|" (car (cdr (nth 3 cc-imenu-c++-generic-expression))) ; -> index += 1 - (prog2 (setq cc-imenu-objc-generic-expression-objc-base-index 9) "") + (prog2 (setq cc-imenu-objc-generic-expression-objc-base-index 10) "") ) - (prog2 (setq cc-imenu-objc-generic-expression-objc-base-index 8) "") + (prog2 (setq cc-imenu-objc-generic-expression-objc-base-index 9) "") "") ; -> index += 0 - (prog2 (setq cc-imenu-objc-generic-expression-proto-index 8) "") + (prog2 (setq cc-imenu-objc-generic-expression-proto-index 9) "") ;; ;; For Objective-C ;; Pick a token by (match-string 8 or 9) -- Alan Mackenzie (Nuremberg, Germany). From unknown Wed Jun 25 00:23:48 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Leo Subject: bug#11142: closed (Re: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode) Message-ID: References: <20120411181523.GA4488@acm.acm> X-Gnu-PR-Message: they-closed 11142 X-Gnu-PR-Package: emacs,cc-mode Reply-To: 11142@debbugs.gnu.org Date: Wed, 11 Apr 2012 18:19:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1334168341-21045-1" This is a multi-part message in MIME format... ------------=_1334168341-21045-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #11142: 24.0.94; objc-mode fails for imenu and which-function-mode which was filed against the emacs,cc-mode package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 11142@debbugs.gnu.org. --=20 11142: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11142 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1334168341-21045-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 11142-done) by debbugs.gnu.org; 11 Apr 2012 18:18:11 +0000 Received: from localhost ([127.0.0.1]:52490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SI27O-0005SN-SV for submit@debbugs.gnu.org; Wed, 11 Apr 2012 14:18:11 -0400 Received: from colin.muc.de ([193.149.48.1]:14663 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SI27M-0005SF-CP for 11142-done@debbugs.gnu.org; Wed, 11 Apr 2012 14:18:09 -0400 Received: (qmail 66691 invoked by uid 3782); 11 Apr 2012 18:16:58 -0000 Received: from acm.muc.de (pD9519D02.dip.t-dialin.net [217.81.157.2]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 11 Apr 2012 20:16:57 +0200 Received: (qmail 6280 invoked by uid 1000); 11 Apr 2012 18:15:24 -0000 Date: Wed, 11 Apr 2012 18:15:23 +0000 To: 11142-done@debbugs.gnu.org Subject: Re: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode Message-ID: <20120411181523.GA4488@acm.acm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11142-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Bug fixed. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1334168341-21045-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Apr 2012 02:35:56 +0000 Received: from localhost ([127.0.0.1]:33450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEAe3-0006XW-N2 for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59065) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEAdp-0006XD-86 for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEAdg-0004ka-7W for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEAdg-0004kW-2W for submit@debbugs.gnu.org; Sat, 31 Mar 2012 22:35:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEAde-0002Qe-I1 for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 22:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEAdb-0004kE-P1 for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 22:35:29 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:57343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEAdb-0004k5-IN for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 22:35:27 -0400 Received: by iajr24 with SMTP id r24so3300547iaj.0 for ; Sat, 31 Mar 2012 19:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:x-debbugs-cc:date:message-id:mime-version :content-type; bh=lB+84W2a0tNF5uWKZeXC8VaTrbrolAuvcTban9bPQzc=; b=xSoINCe+4fiRpEkUHf9++77DCfRjMDDEfATYeqJxpxGLHQ7qcPTAEbujpD6lAEGogt fvmnKUq54aXogz3HPgoSodTAIe1XX/GCllo8TA6sUmlxzeHhdjiJrv7CXcnGFKbwGj4a NehkYFP6pRiC/8jtlSPOSwopnmPiQe5A5KFUxpUepd7yGEp6JBFalJjnf02ZLxevFbmV E+RjZeCvPB814Almx8Qchsertf5zvj9DxghNwPHtsEGxXCY4ei4AilmtZB2bSfdbWXUS r3H1k4mGtp5Jc4Ro4R/y7i8zdMfUzGT0jtPO46FLbogkd+O4Y6mt6Jsls5EqMbsFxTjv hWsA== Received: by 10.50.106.200 with SMTP id gw8mr2784089igb.10.1333247725637; Sat, 31 Mar 2012 19:35:25 -0700 (PDT) Received: from Shidais-iMac.local ([119.255.41.67]) by mx.google.com with ESMTPS id cw5sm5279079igc.17.2012.03.31.19.35.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 31 Mar 2012 19:35:25 -0700 (PDT) From: Leo To: bug-gnu-emacs@gnu.org Subject: 24.0.94; objc-mode fails for imenu and which-function-mode X-Debbugs-CC: bug-cc-mode@gnu.org Date: Sun, 01 Apr 2012 10:34:48 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Turn on which-function-mode and open an objc file, it cannot show the function name. Also, M-x imenu-add-menubar-index says: Error in menu-bar-update-hook (imenu-update-menubar): (wrong-type-argument integerp nil) Leo ------------=_1334168341-21045-1-- From unknown Wed Jun 25 00:23:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11142: 24.0.94; objc-mode fails for imenu and which-function-mode Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 13 Apr 2012 06:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11142 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: Leo , 11142@debbugs.gnu.org, Stefan Monnier Received: via spool by 11142-submit@debbugs.gnu.org id=B11142.133430010821154 (code B ref 11142); Fri, 13 Apr 2012 06:56:01 +0000 Received: (at 11142) by debbugs.gnu.org; 13 Apr 2012 06:55:08 +0000 Received: from localhost ([127.0.0.1]:55489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIaPS-0005V7-DF for submit@debbugs.gnu.org; Fri, 13 Apr 2012 02:55:06 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:34717) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIaPP-0005Uw-HV for 11142@debbugs.gnu.org; Fri, 13 Apr 2012 02:55:04 -0400 Received: from [155.69.18.242] (port=56426 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SIaO7-0005VE-OP; Fri, 13 Apr 2012 02:53:44 -0400 From: Chong Yidong References: <20120406171154.GA3085@acm.acm> Date: Fri, 13 Apr 2012 14:53:30 +0800 In-Reply-To: <20120406171154.GA3085@acm.acm> (Alan Mackenzie's message of "Fri, 6 Apr 2012 17:11:54 +0000") Message-ID: <871unsp1g5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Alan Mackenzie writes: > Brilliant diagnosis, absolutely right! Thanks. There're some pretty > non-standard coding techniques in that file. ;-) > > Here's the final bit of the fix; please try it out if you haven't done > already, and let me know whether it works fully. Hi Alan, Looks like c-defun-name still doesn't work right for objc-mode. Could you take a look at the patch from Jan Dj=C3=A4rv in Bug#9032? Thanks. (Th= at should go into trunk since it's not a regression).