If I have both a major and minor mode in effect, I expect that the MINOR keymap will override. But that's not what happens!
The major map has (among other things) a weird binding for SPC, and it does not have any inserts. By contrast, the minor map inherits from text-mode.
But when the minor mode is in effect, I still don't get any self-inserts, and SPC is still weird. I do see my additional custom minor mode commands. But I wanted the inherited text-mode keys to override the ones that the major mode redefined.
Do I misunderstand the precedence of how keys are looked up, or have I somehow defined my keymaps incorrectly, or is the problem in my mode definitions?
Here is the simplified code:
;; MAJOR MODE
(defvar-keymap sd-mode-map
:parent nil ;still gets most commands?
:suppress t ;get rid of self-insert
"SPC" 'sd-next-line)
(defun sd-mode ()
[...]
(interactive)
(delay-mode-hooks
(setq major-mode 'sd-mode)
(kill-all-local-variables)
(use-local-map sd-mode-map)
;; business
(setq buffer-read-only t))
(run-mode-hooks 'sd-mode-hook))
;; MINOR MODE
(defvar sd-edit-mode-map
(let ((map (make-sparse-keymap "Sd/Edit")))
(set-keymap-parent map text-mode-map)
(define-key map "<right>" 'sd-some-thing)
map)
"My minor mode keymap")
(define-minor-mode sd-edit-mode
"Whatever."
:keymap sd-edit-mode-map
(message "Your minor mode is in effect!")
(setq buffer-read-only nil))
emacs -Q
(no init file) and just the code you posted?