From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#12717: 24.2.50; [PATCH] `imenu--split-submenus' incorrectly distinguishes submenus Date: Tue, 23 Oct 2012 17:07:11 -0700 Message-ID: <9212825D880B4B2581E22420DB3B53DC@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351037294 9790 80.91.229.3 (24 Oct 2012 00:08:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2012 00:08:14 +0000 (UTC) To: 12717@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 02:08:22 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 1TQoWD-0003Oe-NQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 02:08:21 +0200 Original-Received: from localhost ([::1]:59680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQoW5-0002hS-DY for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Oct 2012 20:08:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQoW2-0002gy-40 for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 20:08:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQoW0-0002aG-UP for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 20:08:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQoW0-0002aB-Pk for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 20:08:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TQoXq-0006W7-IC for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 20:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Oct 2012 00:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12717 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.135103737124950 (code B ref -1); Wed, 24 Oct 2012 00:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2012 00:09:31 +0000 Original-Received: from localhost ([127.0.0.1]:58403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TQoXF-0006UH-52 for submit@debbugs.gnu.org; Tue, 23 Oct 2012 20:09:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35906) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TQoXC-0006U5-Rx for submit@debbugs.gnu.org; Tue, 23 Oct 2012 20:09:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQoVF-0002UY-Us for submit@debbugs.gnu.org; Tue, 23 Oct 2012 20:07:22 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:41016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQoVF-0002US-Rd for submit@debbugs.gnu.org; Tue, 23 Oct 2012 20:07:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQoVE-0002aX-NV for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 20:07:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQoVD-0002UE-Md for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 20:07:20 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:39911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQoVD-0002Tz-Fw for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 20:07:19 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9O07Gre001268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Oct 2012 00:07:17 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q9O07FAe026627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 24 Oct 2012 00:07:16 GMT Original-Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q9O07F65032684 for ; Tue, 23 Oct 2012 19:07:15 -0500 Original-Received: from dradamslap1 (/10.159.164.135) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 23 Oct 2012 17:07:15 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac2xe4PVq57W2hb6QZK/dfVKO7ukZw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:65954 Archived-At: Imenu allows the use of something it calls "special" menu elements, which have this form: (INDEX-NAME POSITION FUNCTION ARGUMENTS...) `imenu--split-submenus' needs to distinguish submenus from ordinary menu elements, including from special menu elements. Currently this is bugged. The current code for `imenu--split-submenus' does this: (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)) In GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600) of 2012-10-22 on DANI-PC Bzr revision: 110618 monnier@iro.umontreal.ca-20121022132928-232zm0fecassmhfb Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --no-opt --enable-checking --cflags -I../../libs/libxpm-3.5.8/include -I../../libs/libxpm-3.5.8/src -I../../libs/libpng-1.4.10 -I../../libs/zlib-1.2.6 -I../../libs/giflib-4.1.4-1/include -I../../libs/jpeg-6b-4/include -I../../libs/tiff-3.8.2-1/include -I../../libs/libxml2-2.7.8-w32-bin/include/libxml2 -I../../libs/gnutls-3.0.16/include -I../../libs/libiconv-1.14-2-mingw32-dev/include'