I am using the emacs master build version (25.1.50.x).
(defvar modi-mode-special-map (make-sparse-keymap)
"Special keymap for `modi-mode' whose bindings begin with
`modi-special-keymap-prefix'.")
(fset 'modi-mode-special-map modi-mode-special-map)
(defvar modi-mode-map (let ((map (make-sparse-keymap)))
(define-key map modi-special-keymap-prefix 'modi-mode-special-map)
map)
"Keymap for `modi-mode'.")
;; The keymaps in `emulation-mode-map-alists' take precedence over
;; `minor-mode-map-alist'
(add-to-list 'emulation-mode-map-alists `((modi-mode . ,modi-mode-map)))
=====
Also there was a typo in my previous email:
The strange thing is that
(string-match "." nil) ; *not* (string-match-p ..)
generates proper backtrace as expected ..
=====
The overriding-local-map if non-nil disables all other maps.
And in Emacs<24.4, the same holds for overriding-terminal-local-map.
Could it be you're using a package written for Emacs>=24.4 which sets
a sparse keymap in overriding-terminal-local-map to just override a few
key bindings, but you use it with Emacs<24.4 where that ends up
disabling all other bindings?