3

How to change key-bindings for Calendar Mode only? I'm trying to do something like this:

; original bindings require pressing alt and shift simultaneously
; alt+shift change keyboard layout, so I cannot use those bindings
(define-key calendar-mode-map (kbd "M-]") 'calendar-forward-month)
(define-key calendar-mode-map (kbd "M-[") 'calendar-backward-month)

but calendar-mode-map is void. How can I get name of keymap of Calendar mode (or any arbitrary mode).

8

calendar-mode-map is void since it's not loaded yet:

(eval-after-load "calendar"
  `(progn
     (define-key calendar-mode-map (kbd "M-]") 'calendar-forward-month)
     (define-key calendar-mode-map (kbd "M-[") 'calendar-backward-month)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.