feat(emacs): add input method based on Agda's input method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
87b238efcd
commit
b30d524418
2 changed files with 1058 additions and 21 deletions
1055
emacs/lean-input.el
Normal file
1055
emacs/lean-input.el
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,24 +1,5 @@
|
||||||
(require 'generic-x)
|
(require 'generic-x)
|
||||||
|
(require 'lean-input)
|
||||||
(define-abbrev-table 'lean-mode-abbrev-table '(
|
|
||||||
;; math/unicode symbols
|
|
||||||
("forall" "∀")
|
|
||||||
("exists" "∃")
|
|
||||||
("fun" "λ")
|
|
||||||
("imp" "→")
|
|
||||||
("and" "∧")
|
|
||||||
("or" "∨")
|
|
||||||
("not" "¬")
|
|
||||||
("neq" "≠")
|
|
||||||
("geq" "≥")
|
|
||||||
("leq" "≤")
|
|
||||||
("Nat" "ℕ")
|
|
||||||
("Int" "ℤ")
|
|
||||||
("var" "variable")
|
|
||||||
("vars" "variables")
|
|
||||||
("def" "definition")
|
|
||||||
("th" "theorem")
|
|
||||||
))
|
|
||||||
|
|
||||||
(define-generic-mode
|
(define-generic-mode
|
||||||
'lean-mode ;; name of the mode to create
|
'lean-mode ;; name of the mode to create
|
||||||
|
@ -30,11 +11,12 @@
|
||||||
("\\(->\\|/\\\\\\|==\\|\\\\/\\|[*+/:<=>¬λ→∀∃∧∨≠≤≥-]\\)" . 'font-lock-constant-face))
|
("\\(->\\|/\\\\\\|==\\|\\\\/\\|[*+/:<=>¬λ→∀∃∧∨≠≤≥-]\\)" . 'font-lock-constant-face))
|
||||||
'("\\.lean$") ;; files for which to activate this mode
|
'("\\.lean$") ;; files for which to activate this mode
|
||||||
'((lambda()
|
'((lambda()
|
||||||
(setq local-abbrev-table lean-mode-abbrev-table)
|
(set-input-method "Lean")
|
||||||
(abbrev-mode 1)))
|
(abbrev-mode 1)))
|
||||||
"A mode for Lean files" ;; doc string for this mode
|
"A mode for Lean files" ;; doc string for this mode
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(provide 'lean-mode)
|
||||||
|
|
||||||
; (regexp-opt '("Int" "Bool" "Nat" "Type" "Real") t)
|
; (regexp-opt '("Int" "Bool" "Nat" "Type" "Real") t)
|
||||||
; (regexp-opt '("let" "in" "have" "calc" "forall" "exists") t)
|
; (regexp-opt '("let" "in" "have" "calc" "forall" "exists") t)
|
Loading…
Add table
Reference in a new issue