[slime-devel] `slime-mode-hook' customization not working

I have the following in my ~/.emacs: (add-hook 'slime-mode-hook '(lambda () (local-set-key "\C-c\C-w\C-w" 'insert-wrapping-sexp) (slime-autodoc-mode t))) But in a lisp buffer C-c C-w C-w still runs `slime-calls-who' instead of clobbering that binding - which is what I want it to do. I can't use slime-calls-who (I'm using SBCL) and even if I could, I use C-c C-w C-w so much for `insert-wrapping-sexp' that I'd want to bind slime-calls-who to something else. According to the manual (section 7.1.1, pg. 18) customizations like the one above are supposed to go in `slime-mode-hook'. Is there any way I can fix this? Am I missing something stunningly obvious? Thanks in advance. -- Denis Bueno PGP: http://pgp.mit.edu:11371/pks/lookup?search=0xA1B51B4B&op=index

Denis Bueno <dbueno@gmail.com> writes:
I have the following in my ~/.emacs:
(add-hook 'slime-mode-hook '(lambda () (local-set-key "\C-c\C-w\C-w" 'insert-wrapping-sexp) (slime-autodoc-mode t)))
But in a lisp buffer C-c C-w C-w still runs `slime-calls-who' instead of clobbering that binding - which is what I want it to do. I can't use slime-calls-who (I'm using SBCL) and even if I could, I use C-c C-w C-w so much for `insert-wrapping-sexp' that I'd want to bind slime-calls-who to something else.
According to the manual (section 7.1.1, pg. 18) customizations like the one above are supposed to go in `slime-mode-hook'.
Is there any way I can fix this? Am I missing something stunningly obvious?
Looks to me like the 'local-key-set' is not having the effect that you want. If I eval thats snippet manually with M-: it doesn't override the binding. I'm not sure what the solution is but you are using the right hook.

Denis Bueno <dbueno@gmail.com> writes:
Is there any way I can fix this? Am I missing something stunningly obvious?
SLIME is a minor mode and has its own keymap (slime-mode-map). C-c C-w C-w is bound in that keymap. local-set-key binds a key in the buffer's local map (lisp-mode-map). When Emacs looks up a key, it first looks in the minor mode map and doesn't see your binding. You can either use a different key, say C-c w w, or bind it in the slime-mode-map, with (define-key slime-mode-map ...). Helmut.

On Wed, 09 Mar 2005 08:30:10 +0100, Helmut Eller <e9626484@stud3.tuwien.ac.at> wrote:
You can either use a different key, say C-c w w, or bind it in the slime-mode-map, with (define-key slime-mode-map ...).
`define-key' fixed my problem. Thanks. -- Denis Bueno PGP: http://pgp.mit.edu:11371/pks/lookup?search=0xA1B51B4B&op=index
participants (3)
-
Denis Bueno
-
Helmut Eller
-
Luke Gorrie