Mats Lidell writes:
Gnu version:
(use-local-map (append (make-sparse-keymap) (current-local-map)))
**gag**
As I get it keymaps are objects in XEmacs so appending them
doesn't
work.
Correct.
GNU Emacs also have functions for dealing with keymaps so even
there maybe appending keymaps isn't the best thing!? Maybe use
inheritance there as well?
Dunno. You'd have to ask on emacs-devel. I don't know how they
implement inheritance. Shared list structure may be how they do it.
Is this the proper XEmacs implementation of the code above?
(use-local-map (let ((map (make-sparse-keymap)))
(set-keymap-parent map (current-local-map))
map))
It should work in GNU Emacs as well.
BTW, that `let' shouldn't be necessary. :-/ (But it is.) I really
don't understand why these APIs return the parent(s) (which
necessarily were passed into the code, and so are conveniently
available to the calling code), rather than the new keymap (which
might be created here). Then you could do:
(use-local-map
(set-keymap-parent (make-sparse-keymap) (current-local-map)))
Isn't that ever so much nicer?
Finally - Does this code make sense?
Looks good to me.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta