I have a minor mode that declare a customizable variable as its keymap prefix:
(defcustom mymode-keymap-prefix "C-c *"
"Prefix for `mymode-mode'."
:group 'mymode)
(defvar mymode-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd mymode-keymap-prefix) some-mymode-command-map)
map))
(define-minor-mode mymode-mode
"Mymode."
nil
" mymode"
mymode-mode-map
:group 'mymode)
In my init.el
somewhere I have (require 'mymode-mode)
. I want to make this keymap prefix customizable for user.
This customization must be done before mode is loaded, after that it's too late, mode keymap is already made.
I've tried to open customization buffer with customize-variable mymode-keymap-prefix
and change it but it doesn't work in my case.
When I query the variable after all is loaded it really have value I've put in it but my mode keymap still starts with old prefix as if nothing had happened.
Only approach that work for me is to put (setq mymode-keymap-prefix <new_value>)
before (require 'mymode-mode)
in init.el
.