in Emacs, how to change key bindings for orgstruct-mode? -
i use custom key bindings org-mode:
(eval-after-load "org" '(progn (define-key org-mode-map (kbd "<m-s-left>") nil) (define-key org-mode-map (kbd "<m-s-right>") nil) (define-key org-mode-map (kbd "<m-s-up>") nil) (define-key org-mode-map (kbd "<m-s-down>") nil) (define-key org-mode-map (kbd "<m-left>") nil) (define-key org-mode-map (kbd "<m-right>") nil) (define-key org-mode-map (kbd "<m-right>") nil) (define-key org-mode-map [c-s-right] 'org-shiftmetaright) (define-key org-mode-map [c-s-left] 'org-shiftmetaleft) (define-key org-mode-map [c-right] 'org-metaright) (define-key org-mode-map [c-left] 'org-metaleft) (define-key org-mode-map [c-up] 'org-metaup) (define-key org-mode-map [c-down] 'org-metadown) (define-key org-mode-map [c-s-return] 'org-insert-todo-heading) ))
i'd use these same key bindings in orgstruct-mode, run overtop message-mode. tried doesn't work:
(define-key orgstruct-mode-map (kbd "<m-s-left>") nil) (define-key orgstruct-mode-map (kbd "<m-s-right>") nil) (define-key orgstruct-mode-map (kbd "<m-s-up>") nil) (define-key orgstruct-mode-map (kbd "<m-s-down>") nil) (define-key orgstruct-mode-map (kbd "<m-left>") nil) (define-key orgstruct-mode-map (kbd "<m-right>") nil) (define-key orgstruct-mode-map (kbd "<m-up>") nil) (define-key orgstruct-mode-map (kbd "<m-down>") nil)
how can change key map orgstruct-mode?
defining key nil
unbinds it. unbinding key in orgstruct-mode-map
(the minor mode), you've exposed message-mode-map
(the major mode) bindings. can override message-mode-map
keybindings actively binding keys in orgstruct-mode-map
, if want unbind them, you'll need unbind keys in message-mode-map
well.
here's way unbind of keys in both maps:
(cl-dolist (map '(message-mode-map orgstruct-mode-map)) (cl-dolist (key '("<m-s-left>" "<m-s-right>" "<m-s-up>" "<m-s-down>" "<m-left>" "<m-right>" "<m-up>" "<m-down>")) (define-key (eval map) (kbd key) nil)))
Comments
Post a Comment