elisp question: how to override minor mode key maps?
There's gotta be something better than this (which still isn't right,
because it changes the map for all View buffers and not just *Help*
buffers, and needs to use the not-really-public view-mode-map):
; View-quit seems to get made a bit wonky by "*Help*" being in
; same-window-buffer-names, and we always just want to bury the *Help*
; buffer on quit. So we go and twiddle the non-public variable
; view-mode-map. (Britton Kerin, Mon, 3 Dec 2001 16:24:29 -0900)
(add-hook 'view-mode-hook
(lambda ()
(when (equal (buffer-name) "*Help*")
(substitute-key-definition
'View-quit 'bury-buffer view-mode-map))))
I've also tried using
(make-local-variable 'view-mode-map) as the last argumentto
substitute-key-definition, buth then the new mapping is not effective
anywhere, I suppose because of some closure issue with minor mode keymaps.
Anyone have any ideas?
Britton
Reply to: