Skip to content

Commit 681efc1

Browse files
authored
Merge pull request #155 from tpapp/tp/julia-repl-find-project-directory
Clean up project filename code, fix bugs, make it public API.
2 parents cb511c6 + 3eeb7c4 commit 681efc1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

julia-repl.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,11 @@ name), separated by dots, as a list."
854854
(with-current-buffer (julia-repl-inferior-buffer) (cd directory)))
855855
(warn "buffer not associated with a file")))
856856

857-
(cl-defun julia-repl--find-projectfile (&optional (filename (buffer-file-name)))
858-
"Find a project file in the parent directories of the filename "
859-
(when filename
860-
(cl-flet ((find-projectfile (filename)
861-
(locate-dominating-file (buffer-file-name) filename)))
857+
(cl-defun julia-repl-find-projectfile (&optional (start-filename (buffer-file-name)))
858+
"Find a project file in the parent directories of the `start-filename'. When no such file is found, return `nil' "
859+
(when start-filename
860+
(cl-flet ((find-projectfile (project-filename)
861+
(locate-dominating-file start-filename project-filename)))
862862
(or (find-projectfile "Project.toml")
863863
(find-projectfile "JuliaProject.toml")))))
864864

@@ -871,7 +871,7 @@ When called with a prefix argument, activate the home project."
871871
(progn
872872
(message "activating home project")
873873
(julia-repl--send-string "import Pkg; Pkg.activate()"))
874-
(if-let ((projectfile (julia-repl--find-projectfile)))
874+
(if-let ((projectfile (julia-repl-find-projectfile)))
875875
(progn
876876
(message "activating %s" projectfile)
877877
(julia-repl--send-string

0 commit comments

Comments
 (0)