[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure 6a354dc 097/313: Add defcustom `inf-clojure-pr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure 6a354dc 097/313: Add defcustom `inf-clojure-prompt-on-set-ns` (#46) |
Date: |
Wed, 11 Aug 2021 09:59:54 -0400 (EDT) |
branch: elpa/inf-clojure
commit 6a354dc3ea101c27dcde2c404f314d7ffcd61c03
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Add defcustom `inf-clojure-prompt-on-set-ns` (#46)
The patch allow the user to disable the prompt "Set ns: ..." on `C-c
M-n`. The default is to always prompt.
---
CHANGELOG.md | 1 +
inf-clojure.el | 15 +++++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 99009ea..b5e8134 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
### New Features
* [#34](https://github.com/clojure-emacs/inf-clojure/pull/34): Add support for
socket REPL connections.
+* [#46](https://github.com/clojure-emacs/inf-clojure/pull/46): Make it
possible to disable prompt on `inf-clojure-set-ns`.
* New interactive command `inf-clojure-display-version`.
### Bugs Fixed
diff --git a/inf-clojure.el b/inf-clojure.el
index 13bfeb4..3a445f1 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -179,6 +179,12 @@ This should usually be a combination of
`inf-clojure-prompt' and
:type 'regexp
:group 'inf-clojure)
+(defcustom inf-clojure-prompt-on-set-ns t
+ "Controls whether to prompt when switching namespace."
+ :type '(choice (const :tag "always" t)
+ (const :tag "never" nil))
+ :group 'inf-clojure)
+
(defvar inf-clojure-buffer nil
"The current inf-clojure process buffer.
@@ -620,8 +626,13 @@ See variable `inf-clojure-ns-vars-command'."
(defun inf-clojure-set-ns (ns)
"Set the ns of the inferior Clojure process to NS.
-Defaults to the ns of the current buffer."
- (interactive (inf-clojure-symprompt "Set ns to" (clojure-find-ns)))
+Defaults to the ns of the current buffer, always prompting before
+setting, unless `inf-clojure-prompt-on-set-ns` is nil."
+ (interactive (list (if inf-clojure-prompt-on-set-ns
+ (inf-clojure-symprompt "Set ns to" (clojure-find-ns))
+ (clojure-find-ns))))
+ (when (or (not ns) (equal ns ""))
+ (user-error "No namespace selected"))
(comint-proc-query (inf-clojure-proc) (format inf-clojure-set-ns-command
ns)))
(defun inf-clojure-apropos (var)
- [nongnu] elpa/inf-clojure 64263f7 045/313: Fix a typo, (continued)
- [nongnu] elpa/inf-clojure 64263f7 045/313: Fix a typo, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 8247c43 067/313: Add ElDoc info to README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6758a31 069/313: Fix for older Emacs, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0a7c61b 079/313: Fix a docstring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0259801 080/313: Kill a trailing space, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 63c2f9e 082/313: Add possibility to customize more vars, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d9e4400 087/313: Tweak the README a bit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 117d8cb 090/313: Bump the clojure-mode and Emacs deps, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e12db12 091/313: Fix prompt being included in input history, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure e6a4ef3 093/313: Add some handy GitHub templates to improve the contribution process, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 6a354dc 097/313: Add defcustom `inf-clojure-prompt-on-set-ns` (#46),
ELPA Syncer <=
- [nongnu] elpa/inf-clojure 6e55048 099/313: [Fix #42] Add a defcustom controlling the window in which the REPL buffer is displayed, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 872c143 101/313: Handle properly ANSI color escape sequences in the REPL, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2e1dd6c 108/313: Update the "Usage" section of the README, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 916ec97 106/313: Infer the customization group from defcustom names, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure a36d2a0 111/313: Remove unwanted ansi chars from the REPL output, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 3929054 113/313: Modify CHANGELOG and README for REPL types, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure d265232 115/313: Fix a problem with pcase on inf-clojure-repl-type, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ac74e20 117/313: Kill inf-clojure-var-at-point, ELPA Syncer, 2021/08/11
- [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