From unknown Wed Sep 10 17:01:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12029: 24.1; cc-imenu-objc-function generates invalid imenu alist 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: Mon, 23 Jul 2012 05:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12029 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12029@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.134302246027876 (code B ref -1); Mon, 23 Jul 2012 05:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jul 2012 05:47:40 +0000 Received: from localhost ([127.0.0.1]:58356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StBUa-0007FY-2T for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:47:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52918) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StBUX-0007FQ-7n for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:47:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StBOB-0005wQ-J1 for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:41:04 -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]:40260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBOB-0005wI-Fv for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:41:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBOA-0005XU-3r for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 01:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StBO8-0005w4-Lb for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 01:41:02 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:40630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBO8-0005vw-BF for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 01:41:00 -0400 Received: by pbbrp2 with SMTP id rp2so12298872pbb.0 for ; Sun, 22 Jul 2012 22:40:59 -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=oHaidnPDkvEny98XvHkUa77QZIr9UyeWdhlrDFt0iHA=; b=wvlpUOER//Tr7GdJL8AUPwCftAQGIpXRCOBUtTS2kWZt3haihX+oz0d+49tzncHu6j 0Yzoz/T0mlvzh0Sdu433dNB/stBqgxP20cj0hmsa6seR6BegMRpcTltHRb/CpnIqG2m1 AyeSZRD1lmqhBVC1MfDv2rIJnBYu+WKCNx5UQ2U9EA/jFBf7M7FpJQcvD2seg7W5Qf+j b2+ohpJsQS3uBr/bQAxw7WW6dmVwNshhx5mzfe8wcnciEDbEYJeGGnvVM2AelbsYEX4F anD7gndnQBeESKUQaHZb4PAxtdXreoq3CLuhss+kaH4ZEotwzuWEb0hEg7t9bLPkadwC JBFw== Received: by 10.68.200.98 with SMTP id jr2mr32163430pbc.81.1343022059163; Sun, 22 Jul 2012 22:40:59 -0700 (PDT) Received: from localhost ([119.255.41.67]) by mx.google.com with ESMTPS id wa14sm9258542pbc.10.2012.07.22.22.40.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jul 2012 22:40:58 -0700 (PDT) From: Leo Date: Mon, 23 Jul 2012 13:40:46 +0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 (------) --=-=-= Content-Type: text/plain 1. Open the attached file t.m 2. Move point to be on @interface 3. M-x imenu ,----[ Backtrace ] | Debugger entered--Lisp error: (wrong-type-argument stringp nil) | string-match("\\`@interface\\'" nil) | (if (string-match re (car x)) (throw (quote found) (car x))) | (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) | (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))) | (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))))) | (block nil (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) | (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) | (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))) | (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))))) | (block nil (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x))))) | (if (assoc guess completions) guess (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))))) | (let ((case-fold-search t)) (if (assoc guess completions) guess (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x))))))) | (catch (quote found) (let ((case-fold-search t)) (if (assoc guess completions) guess (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))))))) | imenu-find-default(#("@interface" 0 10 (fontified t face font-lock-keyword-face)) (("*Rescan*" . -99) ("BarCodeViewController(Private)" ("@interface" . 1) ("-initReaderView" . 45)) (nil) ("BarCodeViewController" ("@implementation" . 76) ("-alertView:didDismissWithButtonIndex:" . 140)))) | imenu--completion-buffer((("*Rescan*" . -99) ("BarCodeViewController(Private)" ("@interface" . 1) ("-initReaderView" . 45)) nil ("BarCodeViewController" ("@implementation" . 76) ("-alertView:didDismissWithButtonIndex:" . 140))) nil) | imenu-choose-buffer-index() | (list (imenu-choose-buffer-index)) | call-interactively(imenu t nil) | execute-extended-command(nil) | call-interactively(execute-extended-command nil nil) `---- This is due to cc-imenu-objc-function generates invalid imenu alist: ,----[ C-h v imenu--index-alist RET ] | imenu--index-alist is a variable defined in `imenu.el'. | Its value is nil | | Automatically becomes buffer-local when set in any fashion. | This variable is potentially risky when used as a file local variable. | | Documentation: | The buffer index alist computed for this buffer in Imenu. | | Simple elements in the alist look like (INDEX-NAME . POSITION). | POSITION is the buffer position of the item; to go to the item | is simply to move point to that position. | | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). | To "go to" a special element means applying FUNCTION | to INDEX-NAME, POSITION, and the ARGUMENTS. | | A nested sub-alist element looks like (INDEX-NAME SUB-ALIST). | The function `imenu--subalist-p' tests an element and returns t | if it is a sub-alist. | | There is one simple element with negative POSITION; selecting that | element recalculates the buffer's index alist. | | [back] `---- The following patch fixes this bug: lisp/progmodes/cc-menus.el | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) Modified lisp/progmodes/cc-menus.el diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index a53d65f6..76e3002a 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -399,14 +399,10 @@ (defun cc-imenu-objc-function () str2 "@protocol"))) (setq str (cc-imenu-objc-remove-white-space str)) (setq methodlist (cons (cons str2 - (match-beginning langnum)) + (match-beginning langnum)) methodlist)) - (setq toplist (cons nil (cons (cons str - methodlist) toplist)) + (setq toplist (cons (cons str methodlist) toplist) methodlist nil)))) - ;; - (if (eq (car toplist) nil) - (setq toplist (cdr toplist))) ;; In this buffer, there is only one or zero @{interface|implementation|protocol}. (if (< classcount 2) --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=t.m Content-Description: t.m @interface BarCodeViewController (Private) - (void)initReaderView; @end @implementation BarCodeViewController @synthesize readerView; - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{ if (buttonIndex!=0) { HandInputViewController *handInputViewController = [[HandInputViewController alloc] initWithNibName:@"HandInputViewController" bundle:nil]; handInputViewController.delegate = self; [self presentModalViewController:handInputViewController animated:YES]; [handInputViewController release]; } } @end --=-=-=-- From unknown Wed Sep 10 17:01:34 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#12029: closed (Re: bug#12029: 24.1; cc-imenu-objc-function generates invalid imenu alist) Message-ID: References: X-Gnu-PR-Message: they-closed 12029 X-Gnu-PR-Package: emacs Reply-To: 12029@debbugs.gnu.org Date: Sun, 29 Jul 2012 13:38:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1343569082-13420-1" This is a multi-part message in MIME format... ------------=_1343569082-13420-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #12029: 24.1; cc-imenu-objc-function generates invalid imenu alist which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 12029@debbugs.gnu.org. --=20 12029: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12029 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1343569082-13420-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12029-done) by debbugs.gnu.org; 29 Jul 2012 13:37:24 +0000 Received: from localhost ([127.0.0.1]:47892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SvTgR-0003Te-Cp for submit@debbugs.gnu.org; Sun, 29 Jul 2012 09:37:24 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:35556) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SvTgO-0003TV-0f for 12029-done@debbugs.gnu.org; Sun, 29 Jul 2012 09:37:20 -0400 Received: by pbcwy7 with SMTP id wy7so8233512pbc.3 for <12029-done@debbugs.gnu.org>; Sun, 29 Jul 2012 06:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:face:date :message-id:mime-version:content-type; bh=ohVYax8lIe3zD7XHkNSgSPjOPgN2FRCP6c5dFbTc47U=; b=W8Ej54hX/t/7qFb+DuLhnA7SxDzc+YyMCsvhxzMrVKA4oaMrVqtIOO/6UIJwletLfP P/JrLzJFbd7I8ZCnPD9NbK9/kJZWFb+/uSUALHlyRfJegyQQIyEi1x0pUhuIyv4h0Wrl vlk5fxuOAPSuL9EI6hroaex68jLNEzlzDw69q6bw6jIrT8kzTMntSpoMsiGnOSD5u8+N CxEfE8qXODhVbaVcTFAgugD2zd/yF4EtUi3RYL7LlPEMNg+5HN5LB8L+yYke3DuTvGXw m+UxvjdHayaWP82nI6VM4gXWY/hoCfSCO2CDuRADIIZ3fHAPktUD5NzykrjTqrW17lIi fTKw== Received: by 10.68.224.170 with SMTP id rd10mr25321722pbc.106.1343568610200; Sun, 29 Jul 2012 06:30:10 -0700 (PDT) Received: from localhost ([222.130.140.155]) by mx.google.com with ESMTPS id nh8sm5849297pbc.60.2012.07.29.06.30.06 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jul 2012 06:30:09 -0700 (PDT) From: Leo To: 12029-done@debbugs.gnu.org Subject: Re: bug#12029: 24.1; cc-imenu-objc-function generates invalid imenu alist In-Reply-To: (Leo's message of "Mon, 23 Jul 2012 13:40:46 +0800") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (OS X 10.8) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAElBMVEUAAAAAAP+LRRP0pGC+ vr7///+7mT1iAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMO DhglKe4AAAEsSURBVCjPbZNBboQwDEV/Cd4X9QJRThApmn0XYW+Jyf2v0m+HhqDBgiAe9rcTG7QH w/1Vn2Ar8gBb/ocywSN3qK9T3z4eFDB4eApocBpeBs1RSykoJd8gQcm8pGmHXFso3ajnmsqV0TnY DQkOfXUfN5NwaI7AWTVOyEhcu1aHmdWItHddUVUcUgUBCkitu8V6ditHVOVdqzl2EQ1ZVGTbdK0V 7cqn8vWzoU5Q/bF9Y/Y0cRU1xwkys5dJ+Dt6pBDWifcNQml8Gh2JVmPSoQzo7en0grswkxrUGYJ7 0hSxxAGr7ZMwYcHIzprpi7TENEE1xtiYxixRlCfPBsUUrwHD7uGIwATrbnODJcVrPpVn3hxiGloe m/S+z3CtuzUSMo83N4DPH+F0evwR3P4A2k+75838OKQAAAAASUVORK5CYII= Date: Sun, 29 Jul 2012 21:29:43 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12029-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: -2.6 (--) Fixed in emacs-24. ------------=_1343569082-13420-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Jul 2012 05:47:40 +0000 Received: from localhost ([127.0.0.1]:58356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StBUa-0007FY-2T for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:47:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52918) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StBUX-0007FQ-7n for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:47:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StBOB-0005wQ-J1 for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:41:04 -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]:40260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBOB-0005wI-Fv for submit@debbugs.gnu.org; Mon, 23 Jul 2012 01:41:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBOA-0005XU-3r for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 01:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StBO8-0005w4-Lb for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 01:41:02 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:40630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBO8-0005vw-BF for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 01:41:00 -0400 Received: by pbbrp2 with SMTP id rp2so12298872pbb.0 for ; Sun, 22 Jul 2012 22:40:59 -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=oHaidnPDkvEny98XvHkUa77QZIr9UyeWdhlrDFt0iHA=; b=wvlpUOER//Tr7GdJL8AUPwCftAQGIpXRCOBUtTS2kWZt3haihX+oz0d+49tzncHu6j 0Yzoz/T0mlvzh0Sdu433dNB/stBqgxP20cj0hmsa6seR6BegMRpcTltHRb/CpnIqG2m1 AyeSZRD1lmqhBVC1MfDv2rIJnBYu+WKCNx5UQ2U9EA/jFBf7M7FpJQcvD2seg7W5Qf+j b2+ohpJsQS3uBr/bQAxw7WW6dmVwNshhx5mzfe8wcnciEDbEYJeGGnvVM2AelbsYEX4F anD7gndnQBeESKUQaHZb4PAxtdXreoq3CLuhss+kaH4ZEotwzuWEb0hEg7t9bLPkadwC JBFw== Received: by 10.68.200.98 with SMTP id jr2mr32163430pbc.81.1343022059163; Sun, 22 Jul 2012 22:40:59 -0700 (PDT) Received: from localhost ([119.255.41.67]) by mx.google.com with ESMTPS id wa14sm9258542pbc.10.2012.07.22.22.40.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jul 2012 22:40:58 -0700 (PDT) From: Leo To: bug-gnu-emacs@gnu.org Subject: 24.1; cc-imenu-objc-function generates invalid imenu alist X-Debbugs-CC: bug-cc-mode@gnu.org Date: Mon, 23 Jul 2012 13:40:46 +0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 (------) --=-=-= Content-Type: text/plain 1. Open the attached file t.m 2. Move point to be on @interface 3. M-x imenu ,----[ Backtrace ] | Debugger entered--Lisp error: (wrong-type-argument stringp nil) | string-match("\\`@interface\\'" nil) | (if (string-match re (car x)) (throw (quote found) (car x))) | (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) | (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))) | (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))))) | (block nil (let ((--cl-dolist-temp-- completions) x) (while --cl-dolist-temp-- (setq x (car --cl-dolist-temp--)) (if (string-match re (car x)) (throw (quote found) (car x))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) | (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) | (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))) | (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))))) | (block nil (let ((--cl-dolist-temp-- (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) re) (while --cl-dolist-temp-- (setq re (car --cl-dolist-temp--)) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))) | (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x))))) | (if (assoc guess completions) guess (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))))) | (let ((case-fold-search t)) (if (assoc guess completions) guess (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x))))))) | (catch (quote found) (let ((case-fold-search t)) (if (assoc guess completions) guess (dolist (re (list (concat "\\`" (regexp-quote guess) "\\'") (concat "\\`" (regexp-quote guess)) (concat (regexp-quote guess) "\\'") (regexp-quote guess))) (dolist (x completions) (if (string-match re (car x)) (throw (quote found) (car x)))))))) | imenu-find-default(#("@interface" 0 10 (fontified t face font-lock-keyword-face)) (("*Rescan*" . -99) ("BarCodeViewController(Private)" ("@interface" . 1) ("-initReaderView" . 45)) (nil) ("BarCodeViewController" ("@implementation" . 76) ("-alertView:didDismissWithButtonIndex:" . 140)))) | imenu--completion-buffer((("*Rescan*" . -99) ("BarCodeViewController(Private)" ("@interface" . 1) ("-initReaderView" . 45)) nil ("BarCodeViewController" ("@implementation" . 76) ("-alertView:didDismissWithButtonIndex:" . 140))) nil) | imenu-choose-buffer-index() | (list (imenu-choose-buffer-index)) | call-interactively(imenu t nil) | execute-extended-command(nil) | call-interactively(execute-extended-command nil nil) `---- This is due to cc-imenu-objc-function generates invalid imenu alist: ,----[ C-h v imenu--index-alist RET ] | imenu--index-alist is a variable defined in `imenu.el'. | Its value is nil | | Automatically becomes buffer-local when set in any fashion. | This variable is potentially risky when used as a file local variable. | | Documentation: | The buffer index alist computed for this buffer in Imenu. | | Simple elements in the alist look like (INDEX-NAME . POSITION). | POSITION is the buffer position of the item; to go to the item | is simply to move point to that position. | | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). | To "go to" a special element means applying FUNCTION | to INDEX-NAME, POSITION, and the ARGUMENTS. | | A nested sub-alist element looks like (INDEX-NAME SUB-ALIST). | The function `imenu--subalist-p' tests an element and returns t | if it is a sub-alist. | | There is one simple element with negative POSITION; selecting that | element recalculates the buffer's index alist. | | [back] `---- The following patch fixes this bug: lisp/progmodes/cc-menus.el | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) Modified lisp/progmodes/cc-menus.el diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index a53d65f6..76e3002a 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -399,14 +399,10 @@ (defun cc-imenu-objc-function () str2 "@protocol"))) (setq str (cc-imenu-objc-remove-white-space str)) (setq methodlist (cons (cons str2 - (match-beginning langnum)) + (match-beginning langnum)) methodlist)) - (setq toplist (cons nil (cons (cons str - methodlist) toplist)) + (setq toplist (cons (cons str methodlist) toplist) methodlist nil)))) - ;; - (if (eq (car toplist) nil) - (setq toplist (cdr toplist))) ;; In this buffer, there is only one or zero @{interface|implementation|protocol}. (if (< classcount 2) --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=t.m Content-Description: t.m @interface BarCodeViewController (Private) - (void)initReaderView; @end @implementation BarCodeViewController @synthesize readerView; - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{ if (buttonIndex!=0) { HandInputViewController *handInputViewController = [[HandInputViewController alloc] initWithNibName:@"HandInputViewController" bundle:nil]; handInputViewController.delegate = self; [self presentModalViewController:handInputViewController animated:YES]; [handInputViewController release]; } } @end --=-=-=-- ------------=_1343569082-13420-1--