Actions just about ready, keymap-wise.
This commit is contained in:
parent
b5ad1b1022
commit
955adde578
1 changed files with 7 additions and 6 deletions
|
@ -156,10 +156,14 @@
|
||||||
(defvar magit-key-mode-groups
|
(defvar magit-key-mode-groups
|
||||||
'((logging
|
'((logging
|
||||||
(actions
|
(actions
|
||||||
|
("q" "Exit" bury-buffer)
|
||||||
("l" "One line log" magit-log)
|
("l" "One line log" magit-log)
|
||||||
("L" "Long log" magit-log-long)
|
("L" "Long log" magit-log-long)
|
||||||
("h" "Reflog" magit-reflog)
|
("h" "Reflog" magit-reflog)
|
||||||
("H" "Reflog on head" magit-reflog-head)))))
|
("H" "Reflog on head" magit-reflog-head))))
|
||||||
|
"Holds the key, help, function mapping for the log-mode. If you
|
||||||
|
modify this make sure you reset `magit-key-mode-key-maps' to
|
||||||
|
nil.")
|
||||||
|
|
||||||
(defun magit-key-mode-build-keymap (for-group)
|
(defun magit-key-mode-build-keymap (for-group)
|
||||||
"Construct a normal looking keymap for the key mode to use and
|
"Construct a normal looking keymap for the key mode to use and
|
||||||
|
@ -175,8 +179,6 @@ put it in magit-key-mode-key-maps for fast lookup."
|
||||||
(aput 'magit-key-mode-key-maps for-group map))
|
(aput 'magit-key-mode-key-maps for-group map))
|
||||||
map)))
|
map)))
|
||||||
|
|
||||||
(magit-key-mode 'logging)
|
|
||||||
|
|
||||||
(defun magit-key-mode (for-group)
|
(defun magit-key-mode (for-group)
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((buf (get-buffer-create "*magit-key*")))
|
(let ((buf (get-buffer-create "*magit-key*")))
|
||||||
|
@ -185,8 +187,7 @@ put it in magit-key-mode-key-maps for fast lookup."
|
||||||
(kill-all-local-variables)
|
(kill-all-local-variables)
|
||||||
(make-local-variable 'font-lock-defaults)
|
(make-local-variable 'font-lock-defaults)
|
||||||
(use-local-map
|
(use-local-map
|
||||||
(if (let ((key-map (cdr (assoc for-group magit-key-mode-groups)))))
|
(or (cdr (assoc for-group magit-key-mode-key-maps))
|
||||||
key-map
|
|
||||||
(magit-key-mode-build-keymap for-group)))
|
(magit-key-mode-build-keymap for-group)))
|
||||||
(setq buffer-read-only t)
|
(setq buffer-read-only t)
|
||||||
(setq mode-name "magit-key-mode" major-mode 'magit-key-mode))))
|
(setq mode-name "magit-key-mode" major-mode 'magit-key-mode))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue