From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12717: 24.2.50; [PATCH] `imenu--split-submenus' incorrectly distinguishes submenus Date: Mon, 29 Oct 2012 23:05:15 -0400 Message-ID: References: <9212825D880B4B2581E22420DB3B53DC@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1351566338 18801 80.91.229.3 (30 Oct 2012 03:05:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2012 03:05:38 +0000 (UTC) Cc: 12717@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 30 04:05:47 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TT29B-0006eN-BX for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2012 04:05:45 +0100 Original-Received: from localhost ([::1]:49341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT292-0005lG-TH for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Oct 2012 23:05:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT290-0005l8-7e for bug-gnu-emacs@gnu.org; Mon, 29 Oct 2012 23:05:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TT28z-0005yM-88 for bug-gnu-emacs@gnu.org; Mon, 29 Oct 2012 23:05:34 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT28z-0005yE-4f for bug-gnu-emacs@gnu.org; Mon, 29 Oct 2012 23:05:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TT2BN-000188-Td for bug-gnu-emacs@gnu.org; Mon, 29 Oct 2012 23:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Oct 2012 03:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12717 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 12717-submit@debbugs.gnu.org id=B12717.13515664684326 (code B ref 12717); Tue, 30 Oct 2012 03:08:01 +0000 Original-Received: (at 12717) by debbugs.gnu.org; 30 Oct 2012 03:07:48 +0000 Original-Received: from localhost ([127.0.0.1]:38772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TT2BA-00017j-0m for submit@debbugs.gnu.org; Mon, 29 Oct 2012 23:07:48 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:53790) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TT2B7-00017b-Od for 12717@debbugs.gnu.org; Mon, 29 Oct 2012 23:07:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu0/O+LET/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA6MzgViDBQ X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="203124035" Original-Received: from 206-248-177-19.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([206.248.177.19]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 29 Oct 2012 23:05:16 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id D6369AE4D9; Mon, 29 Oct 2012 23:05:15 -0400 (EDT) In-Reply-To: <9212825D880B4B2581E22420DB3B53DC@us.oracle.com> (Drew Adams's message of "Tue, 23 Oct 2012 17:07:11 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66224 Archived-At: > (defun imenu--split-submenus (alist) > "..." > (mapcar (lambda (elt) > (if (and (consp elt) (stringp (car elt)) (listp (cdr elt))) > (imenu--split-menu (cdr elt) (car elt)) > elt)) > alist)) > The `if' condition should instead test whether the element is a submenu. > We have a function that does that: `imenu--subalist-p'. I believe this > is the correct code: > (defun imenu--split-submenus (alist) > "..." > (mapcar (lambda (elt) > (if (imenu--subalist-p elt) > (imenu--split-menu (cdr elt) (car elt)) > elt)) > alist)) This looks eminently reasonable, except that I don't understand the code enough to be sure (e.g. the current test includes (consp elt) whereas imenu--split-menu starts right off by calling cdr). Do you happen to have some kind of test case? Stefan