-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing unnecessary dependencies #51
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
;; Maintainer: Sebastian Ullrich <[email protected]> | ||
;; Created: Jan 09, 2014 | ||
;; Keywords: languages | ||
;; Package-Requires: ((emacs "27.1") (dash "2.18.0") (s "1.10.0") (f "0.19.0") (flycheck "30") (magit-section "2.90.1") (lsp-mode "8.0.0")) | ||
;; Package-Requires: ((emacs "27.1") (dash "2.18.0") (flycheck "30") (magit-section "2.90.1") (lsp-mode "8.0.0")) | ||
;; URL: https://github.com/leanprover/lean4-mode | ||
;; SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
@@ -74,7 +74,7 @@ If LAKE-NAME is nonempty, then prepend \"LAKE-NAME env\" to the command | |
"Create a temp lean file and return its name. | ||
The new file has prefix PREFIX (defaults to `flymake') and the same extension as | ||
FILE-NAME." | ||
(make-temp-file (or prefix "flymake") nil (f-ext file-name))) | ||
(make-temp-file (or prefix "flymake") nil (file-name-extension file-name))) | ||
|
||
(defun lean4-execute (&optional arg) | ||
"Execute Lean in the current buffer with an optional argument ARG." | ||
|
@@ -90,10 +90,10 @@ FILE-NAME." | |
(buffer-file-name) | ||
(flymake-proc-init-create-temp-buffer-copy 'lean4-create-temp-in-system-tempdir)))) | ||
(compile (lean4-compile-string | ||
(if use-lake (shell-quote-argument (f-full (lean4-get-executable lean4-lake-name))) nil) | ||
(shell-quote-argument (f-full (lean4-get-executable lean4-executable-name))) | ||
(if use-lake (shell-quote-argument (expand-file-name (lean4-get-executable lean4-lake-name))) nil) | ||
(shell-quote-argument (expand-file-name (lean4-get-executable lean4-executable-name))) | ||
(or arg "") | ||
(shell-quote-argument (f-full target-file-name)))) | ||
(shell-quote-argument (expand-file-name target-file-name)))) | ||
;; restore old value | ||
(setq compile-command cc) | ||
(setq default-directory dd))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,6 @@ | |
;;; Code: | ||
|
||
(require 'cl-lib) | ||
(require 'f) | ||
(require 's) | ||
(require 'dash) | ||
(require 'lean4-settings) | ||
|
||
|
@@ -38,16 +36,18 @@ Try to find an executable named `lean4-executable-name' in variable `exec-path'. | |
On succsess, return path to the directory with this executable." | ||
(let ((root (executable-find lean4-executable-name))) | ||
(when root | ||
(setq lean4-rootdir (f-dirname (f-dirname root)))) | ||
(setq lean4-rootdir (file-name-directory | ||
(directory-file-name | ||
(file-name-directory root))))) | ||
lean4-rootdir)) | ||
|
||
(defun lean4-get-rootdir () | ||
"Search for lean executable in `lean4-rootdir' and variable `exec-path'. | ||
First try to find an executable named `lean4-executable-name' in | ||
`lean4-rootdir'. On failure, search in variable `exec-path'." | ||
(if lean4-rootdir | ||
(let ((lean4-path (f-full (f-join lean4-rootdir "bin" lean4-executable-name)))) | ||
(unless (f-exists? lean4-path) | ||
(let ((lean4-path (expand-file-name lean4-executable-name (expand-file-name "bin" lean4-rootdir)))) | ||
(unless (file-exists-p lean4-path) | ||
(error "Incorrect `lean4-rootdir' value, path '%s' does not exist" lean4-path)) | ||
lean4-rootdir) | ||
(or | ||
|
@@ -58,8 +58,8 @@ First try to find an executable named `lean4-executable-name' in | |
|
||
(defun lean4-get-executable (exe-name) | ||
"Return fullpath of lean executable EXE-NAME." | ||
(let ((lean4-bin-dir-name "bin")) | ||
(f-full (f-join (lean4-get-rootdir) lean4-bin-dir-name exe-name)))) | ||
(let ((default-directory (lean4-get-rootdir))) | ||
(expand-file-name exe-name (expand-file-name "bin")))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, this could be |
||
|
||
(defun lean4-line-offset (&optional pos) | ||
"Return the byte-offset of POS or current position. | ||
|
@@ -104,8 +104,8 @@ timer and kill the execution of this function." | |
(-reject | ||
(lambda (file) | ||
(or | ||
(equal (f-filename file) ".") | ||
(equal (f-filename file) ".."))) | ||
(equal (file-name-nondirectory file) ".") | ||
(equal (file-name-nondirectory file) ".."))) | ||
(directory-files path t)))) | ||
mekeor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
;; The following line is the only modification that I made | ||
;; It waits 0.0001 second for an event. This wait allows | ||
|
@@ -115,9 +115,9 @@ timer and kill the execution of this function." | |
(cond (recursive | ||
(mapc | ||
(lambda (entry) | ||
(if (f-file? entry) | ||
(if (file-regular-p entry) | ||
(setq result (cons entry result)) | ||
(when (f-directory? entry) | ||
(when (file-directory-p entry) | ||
(setq result (cons entry result)) | ||
(setq result (append result (lean4--collect-entries entry recursive)))))) | ||
entries)) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use
locate-dominating-file
instead of thelean4-lake-find-dir-in
function defined above: