all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 12717@debbugs.gnu.org
Subject: bug#12717: 24.2.50; [PATCH] `imenu--split-submenus' incorrectly distinguishes submenus
Date: Mon, 29 Oct 2012 23:33:59 -0700	[thread overview]
Message-ID: <0A937822E8694129BBE65DA8B18493FA@us.oracle.com> (raw)
In-Reply-To: <00BA7268CCD34A4CA7D11B7F83CE61E8@us.oracle.com>

Sorry, I was confused in my reply.  This wasn't directly about
`imenu--make-index-alist', but about `imenu--split-submenus'.  I made the fix
for that at the same time, for the same reason (to add the toggle menu items).

`imenu--subalist-p' does this:
(defun imenu--subalist-p (item)
  (and (consp (cdr item)) (listp (cadr item))
       (not (eq (car (cadr item)) 'lambda))))

I don't think it is necessary to check that the elements of the ALIST arg to
`imenu--split-submenus' are conses.  But if you want to be sure that the `cdr'
in `imenu--subalist-p' doesn't cause a problem, then either add a `consp' test
before `imenu--sublist-p' or change the `cdr' to `cdr-safe'.

I'm pretty sure that the ALIST arg will have only cons elements, but I guess
there is no guarantee.

My guess is that the original test (and (consp elt) (stringp (car elt)) (listp
(cdr elt))) was just a feeble attempt to check for a sublmenu.

Anyway, now you know as much as I about the code, and can decide how you want to
fix it.

The point of the bug report is that the current definition ends up trying to
handle a "special" menu item as if it were a submenu: it is a consp with a
string car and listp cdr, but it is not a submenu.  It ends up choking.






  reply	other threads:[~2012-10-30  6:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24  0:07 bug#12717: 24.2.50; [PATCH] `imenu--split-submenus' incorrectly distinguishes submenus Drew Adams
2012-10-30  3:05 ` Stefan Monnier
2012-10-30  6:18   ` Drew Adams
2012-10-30  6:33     ` Drew Adams [this message]
2012-11-15  2:03   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0A937822E8694129BBE65DA8B18493FA@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=12717@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.