fix(emacs/lean-mode.el): invoke lean from project root if existent
This commit is contained in:
parent
5726d45e7f
commit
e3e4f6d648
2 changed files with 5 additions and 1 deletions
|
|
@ -153,6 +153,7 @@ will be flushed everytime it's executed."
|
|||
`("--cache" ,cache-file-name)
|
||||
'()))
|
||||
(lean-mode-option "--lean")
|
||||
(default-directory (or (lean-project-find-root) default-directory))
|
||||
(process-args (append `(,process-name
|
||||
,process-buffer-name
|
||||
,(lean-get-executable lean-executable-name)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@
|
|||
"Project file name")
|
||||
|
||||
(defun lean-project-find-root ()
|
||||
(lean-find-file-upward lean-project-file-name))
|
||||
(let ((p (f--traverse-upwards (f-exists? (f-expand lean-project-file-name it))
|
||||
(f-dirname (buffer-file-name)))))
|
||||
(if p (file-name-as-directory p)
|
||||
nil)))
|
||||
|
||||
(defun lean-project-inside-p ()
|
||||
(if (lean-project-find-root) t nil))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue