Skip to content

Commit c3e939f

Browse files
committed
[Docs] Tweak wording
1 parent 8148298 commit c3e939f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ You can also use the command `cider-kill-last-result`(kbd:[C-c C-v k]) after any
302302
eval command to store its result in the kill ring. This works even when the
303303
`cider-eval-register` feature is disabled.
304304

305-
=== Evaluating inside comments
305+
=== Evaluating code inside comments
306306

307-
By default, when using the defun-style eval commands inside a comment the return value is always `nil`. Calling `cider-eval-defun-up-to-point` with point at `<point>` also returns `nil`:
307+
By default, when using the defun-level eval commands inside a top-level `comment` form the return value is always `nil`. Calling `cider-eval-defun-up-to-point` with point at `<point>` also returns `nil`:
308308

309309
[source,clojure]
310310
----
@@ -316,7 +316,12 @@ By default, when using the defun-style eval commands inside a comment the return
316316
*e)
317317
----
318318

319-
However, as it is often desirable to treat the form the point is in as if was not inside a comment, `clojure-mode` supplies the variable `clojure-toplevel-inside-comment-form`. If this variable is set to `t` then instead of `nil` we get:
319+
That's not a bug, that's simply how the `comment` form works (it simply returns
320+
`nil` when evaluated). However, it is often desirable to treat the form the
321+
point is in as if was not inside a comment. To help with this `clojure-mode`
322+
supplies the variable `clojure-toplevel-inside-comment-form`. If this variable
323+
is set to `t` then `defun`-level commands will ignore the `comment`
324+
wrapper. Let's revisit the previous example:
320325

321326
[source,clojure]
322327
----
@@ -336,7 +341,7 @@ With `cider-eval-defun-at-point` we get:
336341
(let [b "str"]
337342
(-> b
338343
keyword<point>
339-
name));;=> "str"
344+
name)) ;;=> "str"
340345
*e)
341346
----
342347

0 commit comments

Comments
 (0)