[comp.emacs] Recursive menus for EmacsTool

jipping@cs.hope.EDU (Mike Jipping) (08/02/89)

I'm trying to design something and I'm in over my head.  Could someone
help me out?

I need a recursive menu for EmacsTool in SunView.  The situation is that
I want to generate a menu that provides a look at a file tree, where
subdirectories are pullright menus.  Let's say that I define a function
called "gen-file-list" that returns a menu with the files in it. I
"sun-evaluate" the menu and the display is nice.  But when I have
subdirectories, a recursive call to "gen-file-list" is order and somehow
the returned list has to be connected with the current menu list to
provide a pullright.

I have this working for single-level file trees.  I can even recurse fine
and generate what I (think I) need for the pullright menu (i.e., if I
were to "sun-evaluate" the pullright menu on its own, I'd have a nice
menu display).  QUESTION: how do I splice this into the main menu as a
pullright, so that "sun-evaluate" will make it a pullright menu?

I know the form for pullrights is 

   (defmenu <name> 
       (<string-entry> <function>)
       (<string-entry> . <menu-name>))

The last list (with the ".") will cause a pullright menu (i.e.,
<menu-name>) to be generated when the mouse pulls right.  BUT HOW DO I DO
THIS WITHOUT A MENU NAME?  The recursion makes this a hard problem and
means I can't assign the generated file list to an explicitly named menu.

I guess I can limp by this way: (1) generate the current directory level,
then (2) if the selected file is a directory, generate a menu for that
level.  That's the way it's done now.  But, the pullright version is what
I want.

Sorry if the specification is convoluted.  It's hard to describe.  If you
want a visual demonstration, use the mailtool from SunView, make sure
your mail folder is defined, and get a menu over the "Folder" button.
In fact, that's *exactly* what I'm trying to do in Emacs.  I have an
"Emacs Mail Tool" built that mimics Sun's mailtool, but uses "vm" from
Kyle Jones.

Thanks for all the help I can get.  

      Mike Jipping                        Internet: jipping@cs.hope.edu
      Hope College                          BITNET: JIPPING@HOPE
      Department of Computer Science         Voice: Hey!