Skip to content

Commit

Permalink
Add 'repeat-mode' support for agda2-mode
Browse files Browse the repository at this point in the history
This makes use of Emacs 28's repeat-mode that temporarily defines
transient keys for certain commands after they their usage.
  • Loading branch information
Philip Kaludercic authored and phikal committed Feb 21, 2024
1 parent 3503636 commit 5b00ac6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/data/emacs-mode/agda2-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,29 @@ constituents.")
m)
"Bindings for `agda2-mode'.")

(defvar agda2-movement-repeat-map
(let ((m (make-sparse-keymap)))
(define-key m (kbd "C-f") #'agda2-next-goal)
(define-key m (kbd "C-b") #'agda2-previous-goal)
(define-key m (kbd "C-SPC") #'agda2-give)
(define-key m (kbd "C-r") #'agda2-refine)
(define-key m (kbd "C-c") #'agda2-make-case)
(define-key m (kbd "C-,") #'agda2-goal-and-context)
(define-key m (kbd "C-.") #'agda2-goal-and-context-and-inferred)
(define-key m (kbd "C-;") #'agda2-goal-and-context-and-checked)
m)
"Agda bindings to repeat in conjunction with `repeat-mode'.")

(dolist (command '(agda2-next-goal
agda2-previous-goal
agda2-give
agda2-refine
agda2-make-case
agda2-goal-and-context
agda2-goal-and-context-and-inferred
agda2-goal-and-context-and-checked))
(put command 'repeat-map agda2-movement-repeat-map))

(defvar agda2-common-menu-items
'(["Solve constraints" agda2-solve-maybe-all]
["Auto" agda2-auto-maybe-all]
Expand Down

0 comments on commit 5b00ac6

Please sign in to comment.