[slime-devel] Re: C-M-q not working in SLIME 2007-01-20

Ariel Badichi abadichi at bezeqint.net
Tue Jan 23 15:03:25 UTC 2007


Hello,

"Attila Lendvai" <attila.lendvai at gmail.com> writes:

> > So a better fix is:
> >
> > (defvar slime-scratch-mode-map
> >   (let ((map (make-sparse-keymap)))
> >     (set-keymap-parent map lisp-mode-map)
> >     map))
> 
> without knowing too much about keymaps, minor/major modes and their
> interactions... (so take it with a piece of salt...) but how about
> (set-keymap-parent slime-mode-map lisp-mode-map)?
> 

Hmm.  Lisp is a major mode, so it sets up lisp-mode-map as a local
keymap.  Slime is a minor mode, and it can be used with major modes
other than Lisp, though that doesn't seem terribly useful.  Why should
Slime be a keymap hog and absorb lisp-mode-map into slime-mode-map?
Especially when in the general case (non-scratch Lisp Slime buffers)
lisp-mode-map bindings are already active, so there'll be duplication
of bindings, unless you change the local keymap but that seems
perverse.  The SLIME scratch buffer is a special case, and needs its
own local keymap anyway.  Since it gets created with a Lisp major mode
we can reasonably say that its local keymap should be based on
lisp-mode-map.  It would also change the order of key lookup; if
someone comes up with another minor mode that is supposed, say, to
override some Lisp mode keybindings, it could conflict with Slime
then.

> if that works as expected, then that may be a more general solution.
> 
> just a note: in my local copy some time ago i've dropped all those
> dolist's that directly set the keys in the various slime maps
> (sldb-mode-map, slime-xref-mode-map, slime-repl-mode-map) and replaced
> them with set-keymap-parent calls. until now everything works as
> expected (by me), but it needs more time or someone with more
> experience with modes and keymaps to commit it.
> 
> -- 
> - attila
> 
> "- The truth is that I've been too considerate, and so became
> unintentionally cruel...
>  - I understand.
>  - No, you don't understand! We don't speak the same language!"
> (Ingmar Bergman - Smultronstället)

Ariel




More information about the slime-devel mailing list