From 3eeb7c461b36e14c9fb6efbac8a922d96cf87f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20K=2E=20Papp?= Date: Tue, 15 Jul 2025 16:55:33 +0200 Subject: [PATCH] Clean up project filename code, fix bugs, make it public API. --- julia-repl.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/julia-repl.el b/julia-repl.el index 040072a..271f77a 100644 --- a/julia-repl.el +++ b/julia-repl.el @@ -854,11 +854,11 @@ name), separated by dots, as a list." (with-current-buffer (julia-repl-inferior-buffer) (cd directory))) (warn "buffer not associated with a file"))) -(cl-defun julia-repl--find-projectfile (&optional (filename (buffer-file-name))) - "Find a project file in the parent directories of the filename " - (when filename - (cl-flet ((find-projectfile (filename) - (locate-dominating-file (buffer-file-name) filename))) +(cl-defun julia-repl-find-projectfile (&optional (start-filename (buffer-file-name))) + "Find a project file in the parent directories of the `start-filename'. When no such file is found, return `nil' " + (when start-filename + (cl-flet ((find-projectfile (project-filename) + (locate-dominating-file start-filename project-filename))) (or (find-projectfile "Project.toml") (find-projectfile "JuliaProject.toml"))))) @@ -871,7 +871,7 @@ When called with a prefix argument, activate the home project." (progn (message "activating home project") (julia-repl--send-string "import Pkg; Pkg.activate()")) - (if-let ((projectfile (julia-repl--find-projectfile))) + (if-let ((projectfile (julia-repl-find-projectfile))) (progn (message "activating %s" projectfile) (julia-repl--send-string