Date: Tue, 18 Apr 2006 20:00:50 +0200 (CEST) From: Harald Hanche-Olsen hanche@math.ntnu.no
I must disagree. Users aren't supposed to know the name of modes' keymaps: The recommended method of making your own bindings for a given mode is precisely to use local-set-key in a mode hook.
Indeed? I've always just used the modes' key maps. Is this explained in any part of the Emacs or elisp manuals? In the Info node `Major Mode Conventions', the elisp manual says that the key map should be stored permanently in a global variable named `MODENAME-mode-map', so it seems to me that this is meant for users to exploit.
Is the problem here that slime-mode-map is the current local keymap when slime-repl-mode runs lisp-mode-hook? If lisp-mode-map were the local keymap at that point instead, then local-set-key would modify lisp-mode-map. Later, it is safe to make slime-repl-mode-map the local map. It will then shadow lisp-mode-map, and nobody is surprised (too much).
Hmmm. Actually, I can't reproduce the behaviour observed by Kelvin Wu, though I'm using GNU Emacs, not XEmacs. I wonder what C-h c RET says when in the SLIME REPL.