[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure 5d76920 176/313: Introduce inf-clojure-project
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure 5d76920 176/313: Introduce inf-clojure-project-type defcustom |
Date: |
Wed, 11 Aug 2021 10:00:11 -0400 (EDT) |
branch: elpa/inf-clojure
commit 5d769201765fee21f7fa826db1655244a0361f97
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Introduce inf-clojure-project-type defcustom
This patch adds a defcustom, inf-clojure-project-type, so that when it is
not-nil we skip the project detection and choose which inf-clojure-*-cmd
will
be used. This is very useful for projects that don't have standard layouts.
---
CHANGELOG.md | 4 ++++
README.md | 3 +++
inf-clojure.el | 17 +++++++++++++----
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5b34d7..698edb0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,10 @@
* [#93](https://github.com/clojure-emacs/inf-clojure/pull/93): Slow response
from inf-clojure (completions, arglists, ...).
* [#101](https://github.com/clojure-emacs/inf-clojure/pull/101):
`inf-clojure-set-ns` hangs Emacs.
+### New Features
+
+* [#114](https://github.com/clojure-emacs/inf-clojure/pull/114): Introduce
`inf-clojure-project-type` defcustom.
+
## 2.0.1 (2017-05-18)
### Bugs Fixed
diff --git a/README.md b/README.md
index 8f527d1..c3963cb 100644
--- a/README.md
+++ b/README.md
@@ -74,6 +74,9 @@ 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.
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 27b4f03..ecfde28 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -189,6 +189,14 @@ number (e.g. (\"localhost\" . 5555))."
(stringp (car x))
(numberp (cdr x))))
+(defcustom inf-clojure-project-type nil
+ "Defines the project type.
+
+If this is `nil`, the project will be automatically detected."
+ :type 'string
+ :safe #'stringp
+ :package-version '(inf-clojure . "2.1.0"))
+
(defcustom inf-clojure-lein-cmd "lein repl"
"The command used to start a Clojure REPL for Leiningen projects.
@@ -511,10 +519,11 @@ Fallback to `default-directory.' if not within a project."
(defun inf-clojure-project-type ()
"Determine the type, either leiningen or boot of the current project."
- (let ((default-directory (inf-clojure-project-root)))
- (cond ((file-exists-p "project.clj") "lein")
- ((file-exists-p "build.boot") "boot")
- (t nil))))
+ (or inf-clojure-project-type
+ (let ((default-directory (inf-clojure-project-root)))
+ (cond ((file-exists-p "project.clj") "lein")
+ ((file-exists-p "build.boot") "boot")
+ (t "generic")))))
(defun inf-clojure-cmd (project-type)
"Determine the command `inf-clojure' needs to invoke for the PROJECT-TYPE."
- [nongnu] elpa/inf-clojure cfad839 122/313: Officially support lumo -d (dumb terminal) only, (continued)
- [nongnu] elpa/inf-clojure cfad839 122/313: Officially support lumo -d (dumb terminal) only, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure dda0a43 125/313: Fix newline append on eval functions, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 896edd1 131/313: Handle inf-clojure-arglists corner cases, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ebd1494 135/313: Support lumo's apropos, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2341aa2 136/313: Support lumo's source, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 1014e24 141/313: Extend the README a bit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 4a87862 161/313: Calculate response boundaries explicitly, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 15963ca 162/313: Trim the string before checking nil, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure aaaeef6 167/313: Set string safety for all the form defcustoms, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 864356a 172/313: [Fix #75] Remove compilation warnings (#109), ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 5d76920 176/313: Introduce inf-clojure-project-type defcustom,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure f4478ad 183/313: Fix and reword docstring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d4010db 190/313: Add @ (deref) and ^ to the expression breaking chars, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 37b30be 157/313: Bind C-c M-c to inf-clojure-connect, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 49b8c4b 159/313: Restyle inf-clojure-log-activity output, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 21d3e97 171/313: Bump the development version to 2.1.0-snapshot, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 39e794c 168/313: Protect against empty commands, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ae43e2e 178/313: [Fix #113] Send REPL string always, even if empty, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure c4adc89 181/313: Introduce inf-clojure-completions-fn defcustom, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6c719c6 197/313: Avoid leaking buffers from inf-clojure--process-response, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 5aa9c15 212/313: Add clojure socket REPL command and tweak, ELPA Syncer, 2021/08/11