Skip to content

Commit 8ee6dcc

Browse files
committed
Set cider-prompt-for-symbol to nil by default
That was requested numerous times and I feel it makes for a better default.
1 parent 2da3b76 commit 8ee6dcc

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Bump the injected nREPL version to 0.8.1.
1616
* Bump the injected `cider-nrepl` version to `0.25.4`.
1717
* [#2897](https://github.com/clojure-emacs/cider/pull/2897): Translate paths from CIDER to nREPL and vice-versa.
18+
* Set `cider-prompt-for-symbol` to `nil` by default.
1819

1920
## 0.26.1 (2020-08-14)
2021

cider-common.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
(require 'etags) ; for find-tags-marker-ring
3232
(require 'tramp)
3333

34-
(defcustom cider-prompt-for-symbol t
34+
(defcustom cider-prompt-for-symbol nil
3535
"Controls when to prompt for symbol when a command requires one.
3636
3737
When non-nil, always prompt, and use the symbol at point as the default

doc/modules/ROOT/pages/config/basic_config.adoc

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,31 @@ buffers. You can override this behavior, however:
2727
(setq cider-auto-mode nil)
2828
----
2929

30-
== Disable Symbol Confirmation
30+
== Prompt for Symbol Confirmation
3131

32-
By default, CIDER prompts you for a symbol when it executes
33-
interactive commands that require a symbol (e.g. `cider-doc`). The
34-
default symbol will be the one at point. If you set
35-
`cider-prompt-for-symbol` to `nil`, CIDER will try the symbol at point
36-
first, and only prompt if that fails (this was the behavior in older
37-
CIDER releases).
32+
NOTE: The default here was changed in CIDER 1.0.
33+
34+
By default, CIDER won't prompt you for a symbol when it executes
35+
interactive commands that require a symbol (e.g. `cider-doc`). Such
36+
commands operate on the symbol at point and prompt you to provide
37+
a symbol if they can't obtain one automatically.
38+
39+
If you set
40+
`cider-prompt-for-symbol` to `t`, this behavior will be inverted and
41+
CIDER will always prompt you to confirm the symbol on which a command
42+
will operate. This behavior is useful, as it allows you to edit the
43+
inferred symbol, before some operation is carried out with it (and you get to
44+
see what was inferred by `cider-symbol-at-point`).
3845

3946
[source,lisp]
4047
----
41-
(setq cider-prompt-for-symbol nil)
48+
(setq cider-prompt-for-symbol t)
4249
----
4350

51+
TIP: Many interactive commands that operate on the symbol at point,
52+
accept a prefix argument that flips the behavior configured via
53+
`cider-prompt-for-symbol` for the current command invocation.
54+
4455
== Control what window to use when jumping to a definition
4556

4657
By default kbd:[M-.] and other commands that jump to a definition have the following behavior:

doc/modules/ROOT/pages/usage/cider_mode.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,22 @@ kbd:[C-u C-c C-c]
168168
| `cider-doc`
169169
| kbd:[C-c C-d d] +
170170
kbd:[C-c C-d C-d]
171-
| Display doc string for the symbol at point. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol.
171+
| Display doc string for the symbol at point. If invoked with a prefix argument it inverts the value of `cider-prompt-for-symbol`.
172172

173173
| `cider-javadoc`
174174
| kbd:[C-c C-d j] +
175175
kbd:[C-c C-d C-j]
176-
| Display JavaDoc (in your default browser) for the symbol at point. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol.
176+
| Display JavaDoc (in your default browser) for the symbol at point. If invoked with a prefix argument it inverts the value of `cider-prompt-for-symbol`.
177177

178178
| `cider-clojuredocs`
179179
| kbd:[C-c C-d c] +
180180
kbd:[C-c C-d C-c]
181-
| Lookup symbol in ClojureDocs.
181+
| Lookup symbol in ClojureDocs. If invoked with a prefix argument it inverts the value of `cider-prompt-for-symbol`.
182182

183183
| `cider-clojuredocs-web`
184184
| kbd:[C-c C-d w] +
185185
kbd:[C-c C-d C-w]
186-
| Open the ClojureDocs documentation for symbol in a web browser.
186+
| Open the ClojureDocs documentation for symbol in a web browser. If invoked with a prefix argument it inverts the value of `cider-prompt-for-symbol`.
187187

188188
| `cider-apropos`
189189
| kbd:[C-c C-d a] +
@@ -206,15 +206,15 @@ kbd:[C-c C-d C-e]
206206

207207
| `cider-toggle-trace-var`
208208
| kbd:[C-c M-t v]
209-
| Toggle var tracing.
209+
| Toggle var tracing. If invoked with a prefix argument it inverts the value of `cider-prompt-for-symbol`.
210210

211211
| `cider-toggle-trace-ns`
212212
| kbd:[C-c M-t n]
213213
| Toggle namespace tracing.
214214

215215
| `cider-undef`
216216
| kbd:[C-c C-u]
217-
| Undefine a symbol. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol.
217+
| Undefine a symbol. If invoked with a prefix argument it inverts the value of `cider-prompt-for-symbol`.
218218

219219
| `cider-test-run-test`
220220
| kbd:[C-c C-t t] +
@@ -253,7 +253,7 @@ kbd:[C-c C-t C-b]
253253

254254
| `cider-find-var`
255255
| kbd:[M-.]
256-
| Jump to the definition of a symbol. If invoked with a prefix argument, or no symbol is found at point, prompt for a symbol.
256+
| Jump to the definition of a symbol. If invoked with a prefix argument it inverts the value of `cider-prompt-for-symbol`.
257257

258258
| `cider-find-dwim-at-mouse`
259259
| kbd:[mouse-5] or kbd:[mouse-9]

0 commit comments

Comments
 (0)