From xemacs-m  Wed Jan 22 15:38:41 1997
Received: from cs.uchicago.edu (alexandria.cs.uchicago.edu [128.135.11.87])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id PAA10659 for <xemacs-beta@xemacs.org>; Wed, 22 Jan 1997 15:38:39 -0600 (CST)
Received: from gargoyle164.cs.uchicago.edu (gargoyle20 [128.135.20.100]) by cs.uchicago.edu (8.8.3/8.7.3) with ESMTP id PAA12745 for <xemacs-beta@xemacs.org>; Wed, 22 Jan 1997 15:38:37 -0600 (CST)
Received: (from csdayton@localhost) by gargoyle164.cs.uchicago.edu (8.8.3/8.7.3) id PAA01411; Wed, 22 Jan 1997 15:38:36 -0600 (CST)
To: xemacs-beta@xemacs.org
Subject: Re: imenu.el
References: <199701222029.PAA28300@anthem.CNRI.Reston.Va.US>
X-Face: `X="Sg7A[PL3/_8;>>ggjOy&\KtWiH7.wQ>Y"hQ2fxSG9RkPTCT}&^()5[Gp(-DaTf:t`MSBt@Li_C9U@y#i/c?i$uLQ8[';I$mMAm_rZta>l`STW_aA5`iD[!80p#_qmN4#tMu[Pu7wkIi)5*4YXAhg)9R2-BAWPbVOzgE$Ib4QuZn0YaE~'C/7h^CTuPybz$u
Mime-Version: 1.0 (generated by tm-edit 7.100)
Content-Type: text/plain; charset=US-ASCII
From: Soren Dayton <csdayton@cs.uchicago.edu>
Date: 22 Jan 1997 15:38:35 -0600
In-Reply-To: "Barry A. Warsaw"'s message of Wed, 22 Jan 1997 15:29:33 -0500
Message-ID: <xcd4tg9tmp0.fsf@gargoyle164.cs.uchicago.edu>
Lines: 46
X-Mailer: Gnus v5.2.40/XEmacs 20.0

"Barry A. Warsaw" <bwarsaw@cnri.reston.va.us> writes:

> Looks like imenu is now bundled with XEmacs (modes/imenu.el), but
> there's a problem with imenu-add-to-menubar if the lookup-key in the
> let fails.  I do not use a menubar so code that was calling this
> function was getting an error.  Here's a simple patch so that
> imenu-add-to-menubar does nothing if the menu-bar is nil.
> 
> BTW, does imenu now work with XEmacs?
 
Not really.  I was looking at fixing that, but my courses have been
claiming nearly all my time in the last two weeks.  Joseph Sudish had
some patches to make the mouse event stuff work, but there is still a
problem that keymaps are treated as lists rather than some sort of
opaque data structure. Note the nconc's in the code below...

Soren

> -------------------- snip snip --------------------
> *** imenu.el	1997/01/22 20:23:43	1.1
> --- imenu.el	1997/01/22 20:25:37
> ***************
> *** 806,815 ****
>     (let ((newmap (make-sparse-keymap))
>   	(menu-bar (lookup-key (current-local-map) [menu-bar])))
> !     (define-key newmap [menu-bar]
> !       (append (make-sparse-keymap) menu-bar))
> !     (define-key newmap [menu-bar index]
> !       (cons name (nconc (make-sparse-keymap "Imenu")
> ! 			(make-sparse-keymap))))
> !     (use-local-map (append newmap (current-local-map))))
>     (add-hook 'menu-bar-update-hook 'imenu-update-menubar))
>   
> --- 806,816 ----
>     (let ((newmap (make-sparse-keymap))
>   	(menu-bar (lookup-key (current-local-map) [menu-bar])))
> !     (if (not menu-bar) nil
> !       (define-key newmap [menu-bar]
> ! 	(append (make-sparse-keymap) menu-bar))
> !       (define-key newmap [menu-bar index]
> ! 	(cons name (nconc (make-sparse-keymap "Imenu")
> ! 			  (make-sparse-keymap))))
> !       (use-local-map (append newmap (current-local-map)))))
>     (add-hook 'menu-bar-update-hook 'imenu-update-menubar))
>   
> 

