emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assignment of misc packages for emacs


From: Stefan Monnier
Subject: Re: Assignment of misc packages for emacs
Date: Mon, 10 Jun 2002 10:35:54 -0400

> It seems to use _multiple_ keymaps (the MAPS and NMAPS parameters),

Yes, one might come from the global map, another from the local map,
yet others from various minor mode maps.

> which it merges to get all the menu entries.  Can any explain in what
> situation you end up with multiple keymaps that need to be merged like
> this?

They may all share the same prefix.

> Should the lisp function be passed a list of keymaps?

I think so, yes.

> It would also be nice to have some helper functions/forms to assist lisp
> code in manipulating the keymaps without caring too much about the
> details.
> 
> For this current application, for instance, I'd like:
> 
>   1) something to iterate over the keymaps
> 
>      E.g. perhaps (dobindings (VAR KEYMAP [PREDICATE]) BODY..)

XEmacs has map-keymap (and so does lucid.el).
CL has cl-map-keymap used internally for the `loop' macro where you can
loop over keybindings.
`map_keymap' (c|sh)ould also be used internally to avoid exposing the
internal representation of keymaps all over keyboard.c.

>   2) accessor functions of some sort for the tricky bits
> 
>      For menu-items, as I mentioned earlier, there's already this handy
>      C function `parse_menu_item' which could be used to do the bulk of
>      the work for any accessor function(s).
> 
>      I'm not sure what would be better though, a bunch of individual
>      accessor functions, e.g., (menu-item-help MENU-ITEM), or one big
>      accessor function like (menu-item-property MENU-ITEM :help).
> 
>      The second would probably be easier to implement, since
>      parse_menu_item fills in a table, so a general accessor funciton
>      like `menu-item-property' could just have a list of
>      keyword->table-index mappings.

How about (menu-item-property (parse-menu-item MENU-ITEM) :help) ?
Parsing can take a non-negligible time (it can run elisp code among
other things) so it would be good to be able to separate it from accessing
the actual data.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]