feat(emacs): make lean-mode org-mode friendly
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
99a1966fd6
commit
bc0a8b8da4
1 changed files with 7 additions and 1 deletions
|
@ -1,14 +1,20 @@
|
|||
(require 'generic-x)
|
||||
(require 'lean-input)
|
||||
(require 'compile)
|
||||
(require 'flymake)
|
||||
|
||||
(defvar lean-exe "lean"
|
||||
"Path for the Lean executable")
|
||||
|
||||
(defun flymake-create-temp-lean-in-system-tempdir (filename prefix)
|
||||
(make-temp-file (or prefix "flymake") nil ".lean"))
|
||||
|
||||
(defun lean-execute ()
|
||||
"Execute Lean in the current buffer"
|
||||
(interactive)
|
||||
(compile (format "%s %s" lean-exe (buffer-file-name))))
|
||||
(if (buffer-file-name)
|
||||
(compile (format "%s %s" lean-exe (buffer-file-name)))
|
||||
(compile (format "%s %s" lean-exe (flymake-init-create-temp-buffer-copy 'flymake-create-temp-lean-in-system-tempdir)))))
|
||||
|
||||
(defun lean-set-keys ()
|
||||
(local-set-key "\C-c\C-x" 'lean-execute)
|
||||
|
|
Loading…
Reference in a new issue