From 1932778a66bb32000f82ded2a182d50080988ea3 Mon Sep 17 00:00:00 2001 From: dan sutton Date: Sat, 25 Apr 2020 11:43:49 -0500 Subject: [PATCH] Use clojure-mode project detection benefits we also get the project type caching and all of the project types --- CHANGELOG.md | 1 + inf-clojure.el | 19 ++----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index decc2f5..0c85fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### New features +* [#173](https://github.com/clojure-emacs/inf-clojure/issues/173): Use clojure-mode project detection instead of duplicate version in inf-clojure * [#174](https://github.com/clojure-emacs/inf-clojure/pull/174): Set REPL type from startup form or prompt at startup, introduce `inf-clojure-custom-repl-type` defcustom. * [#174](https://github.com/clojure-emacs/inf-clojure/pull/174): Invoke `inf-clojure` with a prefix argument to prevent using `inf-clojure-custom-startup` and `inf-clojure-custom-repl-type. diff --git a/inf-clojure.el b/inf-clojure.el index fed299b..a78774a 100644 --- a/inf-clojure.el +++ b/inf-clojure.el @@ -595,21 +595,6 @@ to continue it." (inf-clojure-chomp (concat "\n" (inf-clojure-remove-subprompts str)))) (t str))) -(defvar inf-clojure-project-root-files - '("project.clj" "build.boot" "deps.edn" "shadow-cljs.edn") - "A list of files that can be considered project markers.") - -(defun inf-clojure-project-root () - "Retrieve the root directory of a project if available. - -Fallback to `default-directory.' if not within a project." - (or (car (remove nil - (mapcar (lambda - (file) - (locate-dominating-file default-directory file)) - inf-clojure-project-root-files))) - default-directory)) - (defun inf-clojure-clear-repl-buffer () "Clear the REPL buffer." (interactive) @@ -682,7 +667,7 @@ process buffer for a list of commands.)" 'confirm-after-completion)))) (if (not (comint-check-proc "*inf-clojure*")) ;; run the new process in the project's root when in a project folder - (let ((default-directory (inf-clojure-project-root)) + (let ((default-directory (clojure-project-dir)) (cmdlist (if (consp cmd) (list cmd) (split-string cmd))) @@ -957,7 +942,7 @@ STRING if present." (prin1-to-string (substring-no-properties string)))) nil (expand-file-name inf-clojure--log-file-name - (inf-clojure-project-root)) + (clojure-project-dir)) 'append 'no-annoying-write-file-in-minibuffer)))