Open dabrahams opened 1 year ago
e.g., this works:
(unless overriding-terminal-local-map
(setq overriding-terminal-local-map (make-sparse-keymap)))
(define-key overriding-terminal-local-map [(control return)] 'other-window)
Egh, but overriding-terminal-local-map
also gets cleared from time-to-time; I'm still trying to figure out when/why.
Egh, but
overriding-terminal-local-map
also gets cleared from time-to-time; I'm still trying to figure out when/why.
Did you find out more here? What is the issue you are seeing and how can I reproduce it?
Sorry, everything I know, which isn't much, is captured here
That link is giving me "404 Not Found".
Sorry, that repo is private for stupid reasons. The code in question is:
;; Prepare the keymap for my globally-overriding bindings.
(unless overriding-terminal-local-map
(setq overriding-terminal-local-map (make-sparse-keymap)))
(defmacro dwa/global-key (key-name command &optional predicate)
"Bind KEY-NAME to COMMAND in a way that's hard to override.
Forwards its arguments to `bind-key*', which see."
`(progn
(bind-key ,key-name ,command overriding-terminal-local-map ,predicate)
;; the above works for a while, but then overriding-terminal-local-map gets stomped on,
;; so add insurance with `bind-key*', which is imperfect (Magit overrides it).
(bind-key* ,key-name ,command ,predicate)))
And note that it doesn't really work very well.
Apparently you need to use
overriding-terminal-local-map
to achieve that.