help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Redefine the `special-mode-map'


From: Alexander Shukaev
Subject: Redefine the `special-mode-map'
Date: Fri, 9 Jan 2015 05:26:41 +0100

Hello everyone,

I'd like to redefine the `special-mode-map'. Accordingly, in the very
beginning of my Emacs configuration I've added the following code:

    (let ((keymap (make-sparse-keymap)))
      (suppress-keymap keymap)
      (define-key keymap (kbd "q") #'quit-window)
      (define-key keymap (kbd "r") #'revert-buffer)
      (setq special-mode-map keymap))

I assume that all the modes which are either derived from `special-mode' or
have `special-mode-map' as a parent to their respective maps should indeed
inherit the above key bindings.

However, this is not the case. [C-h][b] shows that the above code had no
effect and that the default value of `special-mode-map' was still used as a
parent to construct child maps. In contrast, to complicate things,
[C-h][v]special-mode-map shows that `special-mode-map' contains all the
above changes. So what is going on? How to solve this problem?

Thanks and regards,
Alexander


reply via email to

[Prev in Thread] Current Thread [Next in Thread]