add: mode map alist order

master
Mao 6 years ago
parent 14a99afb3b
commit d5b9ed971d
  1. 11
      eaf.el

@ -162,6 +162,9 @@ Don't modify this map directly. To bind keys for all apps use
(defvar-local eaf--buffer-map-alist nil
"EAF buffer-local map alist.")
(defvar-local eaf--buffer-map-alist-order 1
"Order of EAF buffer-local map alist in `emulation-mode-map-alists'.")
(define-derived-mode eaf-mode fundamental-mode "EAF"
"Major mode for Emacs Application Framework buffers.
@ -182,11 +185,15 @@ been initialized."
(setq-local bookmark-make-record-function #'eaf--bookmark-make-record)
;; Copy default value in case user already has bindings there
(setq-local emulation-mode-map-alists (default-value 'emulation-mode-map-alists))
(setq-local emulation-mode-map-alists
(default-value 'emulation-mode-map-alists))
;; Construct map alist
(setq-local eaf--buffer-map-alist (list (cons t eaf-mode-map)))
;; Eanble mode map and make it the first priority
(add-to-ordered-list 'emulation-mode-map-alists 'eaf--buffer-map-alist 1)
(add-to-ordered-list
'emulation-mode-map-alists
'eaf--buffer-map-alist
'eaf--buffer-map-alist-order)
(add-hook 'kill-buffer-hook #'eaf--monitor-buffer-kill nil t)
(add-hook 'kill-emacs-hook #'eaf--monitor-emacs-kill))

Loading…
Cancel
Save