emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-clojure 8c27b06 177/313: Introduce the tools.deps proj


From: ELPA Syncer
Subject: [nongnu] elpa/inf-clojure 8c27b06 177/313: Introduce the tools.deps project type
Date: Wed, 11 Aug 2021 10:00:11 -0400 (EDT)

branch: elpa/inf-clojure
commit 8c27b0603971e603db686131c3e411a02579501d
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>

    Introduce the tools.deps project type
    
    The new inf-clojure-tools-deps-cmd will be used when the deps.edn file is 
going
    to be detected in the project root.
---
 CHANGELOG.md   |  1 +
 README.md      | 12 ++++++------
 inf-clojure.el | 17 ++++++++++++++++-
 3 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 698edb0..b023e55 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@
 ### New Features
 
 * [#114](https://github.com/clojure-emacs/inf-clojure/pull/114): Introduce 
`inf-clojure-project-type` defcustom.
+* [#117](https://github.com/clojure-emacs/inf-clojure/pull/117): Introduce 
`tools.deps` project type and `inf-clojure-tools-deps-cmd`.
 
 ## 2.0.1 (2017-05-18)
 
diff --git a/README.md b/README.md
index c3963cb..f528b1c 100644
--- a/README.md
+++ b/README.md
@@ -71,12 +71,12 @@ Just invoke `M-x inf-clojure` or press `C-c C-z` within a 
Clojure source file.
 This will start a REPL process for the current project and you can start
 interacting with it.
 
-`inf-clojure` has several custom variables which control the command
-used to start a REPL for particular project type - `inf-clojure-lein-cmd`,
-`inf-clojure-boot-cmd` and `inf-clojure-generic-cmd`.
-The `inf-clojure-project-type` can force a particular project type, skipping
-the project detection, which can be useful for projects that don't have
-standard layouts.
+`inf-clojure` has several custom variables which control the command used to
+start a REPL for particular project type - `inf-clojure-lein-cmd`,
+`inf-clojure-boot-cmd`, `inf-clojure-tools-deps-cmd` and
+`inf-clojure-generic-cmd`.  The `inf-clojure-project-type` can force a
+particular project type, skipping the project detection, which can be useful
+for projects that don't have standard layouts.
 
 By default all those variables are set to strings (e.g. `lein repl`).
 However, it is possible to use a cons pair like `("localhost" . 5555)`
diff --git a/inf-clojure.el b/inf-clojure.el
index ecfde28..3bd4bfe 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -225,6 +225,19 @@ often connecting to a remote REPL process."
   :safe #'inf-clojure--endpoint-p
   :package-version '(inf-clojure . "2.0.0"))
 
+(defcustom inf-clojure-tools-deps-cmd "clj"
+  "The command used to start a Clojure REPL for tools.deps projects.
+
+Alternatively you can specify a TCP connection cons pair, instead
+of command, consisting of a host and port
+number (e.g. (\"localhost\" . 5555)).  That's useful if you're
+often connecting to a remote REPL process."
+  :type '(choice (string)
+                 (cons string integer))
+  :risky #'stringp
+  :safe #'inf-clojure--endpoint-p
+  :package-version '(inf-clojure . "2.1.0"))
+
 (defcustom inf-clojure-generic-cmd "lein repl"
   "The command used to start a Clojure REPL outside Lein/Boot projects.
 
@@ -503,7 +516,7 @@ to continue it."
    (t str)))
 
 (defvar inf-clojure-project-root-files
-  '("project.clj" "build.boot")
+  '("project.clj" "build.boot" "deps.edn")
   "A list of files that can be considered project markers.")
 
 (defun inf-clojure-project-root ()
@@ -523,6 +536,7 @@ Fallback to `default-directory.' if not within a project."
       (let ((default-directory (inf-clojure-project-root)))
         (cond ((file-exists-p "project.clj") "lein")
               ((file-exists-p "build.boot") "boot")
+              ((file-exists-p "deps.edn") "tools.deps")
               (t "generic")))))
 
 (defun inf-clojure-cmd (project-type)
@@ -530,6 +544,7 @@ Fallback to `default-directory.' if not within a project."
   (pcase project-type
     ("lein" inf-clojure-lein-cmd)
     ("boot" inf-clojure-boot-cmd)
+    ("tools.deps" inf-clojure-tools-deps-cmd)
     (_ inf-clojure-generic-cmd)))
 
 (defun inf-clojure-clear-repl-buffer ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]