branch: elpa/cider
commit 9f54981305d73bac1e45a066c1a29838114e74a8
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Call the #_ reader macro "discard", matching Clojure's terminology
    
    Clojure and edn officially call `#_` the discard reader macro, so rename the
    `cider-comment-style' option value `ignore' to `discard' (safe - the option 
is
    new this cycle and unreleased) and align the docstring, customize tag, docs
    and CHANGELOG.  Also rename the internal `cider--debug-skip-ignored-forms' 
to
    `cider--debug-skip-discarded-forms' so the term is consistent throughout.
---
 CHANGELOG.md                                      | 2 +-
 doc/modules/ROOT/pages/usage/code_evaluation.adoc | 4 ++--
 lisp/cider-debug.el                               | 6 +++---
 lisp/cider-eval.el                                | 8 ++++----
 test/cider-eval-tests.el                          | 6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e348998241..98a4908d24 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,7 +31,7 @@
 - [#3990](https://github.com/clojure-emacs/cider/pull/3990): Add 
`cider-trace`, opening a dedicated `*cider-trace*` buffer that streams the 
calls and return values of traced functions live, instead of interleaving them 
into the REPL (requires a recent enough `cider-nrepl`).
 - [#3989](https://github.com/clojure-emacs/cider/pull/3989): Add 
`cider-list-traced` to show the vars and namespaces that are currently traced, 
and `cider-untrace-all` to clear all tracing at once (both require a recent 
enough `cider-nrepl`).
 - [#3988](https://github.com/clojure-emacs/cider/pull/3988): Add 
`cider-enlighten-defun-at-point` to enlighten a single top-level form without 
toggling the global `cider-enlighten-mode`, and `cider-enlighten-clear` to 
remove the enlighten overlays from a buffer.
-- [#3964](https://github.com/clojure-emacs/cider/pull/3964): Add 
`cider-comment-style` to control how the eval-to-comment commands format the 
inserted result (`line`, `ignore` or `comment`).
+- [#3964](https://github.com/clojure-emacs/cider/pull/3964): Add 
`cider-comment-style` to control how the eval-to-comment commands format the 
inserted result (`line`, `discard` or `comment`).
 - [#3965](https://github.com/clojure-emacs/cider/pull/3965): Add 
`cider-send-to-comment` to copy the top-level form at point into the 
namespace's rich `comment` block (`C-c C-j c`), optionally evaluating it, and 
`cider-jump-to-comment` to visit the block (`C-c C-j v`).
 - [#3963](https://github.com/clojure-emacs/cider/pull/3963): Attach 
`cider-scratch` buffers to a specific session (one scratchpad per session), 
with a configurable eval destination (cljc-style by default).
 - [#3966](https://github.com/clojure-emacs/cider/pull/3966): Add 
`cider-set-eval-destination` and `cider-cycle-eval-destination` (`C-c C-M-d`) 
to override, per buffer, which REPL type (clj, cljs or multi) evaluations 
dispatch to.
diff --git a/doc/modules/ROOT/pages/usage/code_evaluation.adoc 
b/doc/modules/ROOT/pages/usage/code_evaluation.adoc
index de9d734db5..dbcd11385b 100644
--- a/doc/modules/ROOT/pages/usage/code_evaluation.adoc
+++ b/doc/modules/ROOT/pages/usage/code_evaluation.adoc
@@ -385,12 +385,12 @@ The available styles are:
 * `line` - a line comment, e.g. `+;; => 42+`. This is the default and honors 
the
 `cider-comment-prefix`, `cider-comment-continued-prefix` and
 `cider-comment-postfix` options.
-* `ignore` - a reader ignore form, e.g. `+#_42+`. Handy when the result is a 
data
+* `discard` - a reader discard form, e.g. `+#_42+`. Handy when the result is a 
data
 structure you want to keep as a navigable, editable Clojure datum rather than
 comment text.
 * `comment` - a `comment` form, e.g. `+(comment 42)+`.
 
-NOTE: The `ignore` and `comment` styles ignore the `cider-comment-*` prefix
+NOTE: The `discard` and `comment` styles ignore the `cider-comment-*` prefix
 options and use their own fixed formatting.
 
 Re-evaluating a form replaces any existing eval comment in-place, rather than 
inserting a second one.
diff --git a/lisp/cider-debug.el b/lisp/cider-debug.el
index c0eed261af..cb355cb564 100644
--- a/lisp/cider-debug.el
+++ b/lisp/cider-debug.el
@@ -650,8 +650,8 @@ REASON is a keyword describing why this buffer was 
necessary."
     (search-forward-regexp (concat "\\_<" (regexp-quote key) "\\_>")
                            limit 'noerror)))
 
-(defun cider--debug-skip-ignored-forms ()
-  "Skip past all forms ignored with #_ reader macro."
+(defun cider--debug-skip-discarded-forms ()
+  "Skip past all forms discarded with the #_ reader macro."
   ;; Logic taken from `clojure--search-comment-macro-internal'
   (while (looking-at (concat "[ ,\r\t\n]*" clojure--comment-macro-regexp))
     (let ((md (match-data))
@@ -737,7 +737,7 @@ key of a map, and it means \"go to the value associated 
with this key\"."
               ;; entire #(...), so we should move back out.
               (backward-up-list)))
           ;; Finally skip past all #_ forms
-          (cider--debug-skip-ignored-forms))
+          (cider--debug-skip-discarded-forms))
         ;; Place point at the end of instrumented sexp.
         (clojure-forward-logical-sexp 1))
     ;; Avoid throwing actual errors, since this happens on every breakpoint.
diff --git a/lisp/cider-eval.el b/lisp/cider-eval.el
index 461e0df126..2e398a3ffe 100644
--- a/lisp/cider-eval.el
+++ b/lisp/cider-eval.el
@@ -193,14 +193,14 @@ The available styles are:
   `line'    -- a line comment (e.g. \";; => 42\").  This is the default and
                honors the `cider-comment-prefix', 
`cider-comment-continued-prefix'
                and `cider-comment-postfix' options.
-  `ignore'  -- a reader ignore form (e.g. \"#_42\"), which keeps the result as 
a
+  `discard' -- a reader discard form (e.g. \"#_42\"), which keeps the result 
as a
                navigable Clojure datum rather than comment text.
   `comment' -- a `comment' form (e.g. \"(comment 42)\").
 
-The `ignore' and `comment' styles ignore the `cider-comment-*' prefix options
+The `discard' and `comment' styles ignore the `cider-comment-*' prefix options
 and use their own fixed formatting."
   :type '(choice (const :tag "Line comment (;; =>)" line)
-                 (const :tag "Reader ignore form (#_)" ignore)
+                 (const :tag "Reader discard form (#_)" discard)
                  (const :tag "Comment form (comment ...)" comment))
   :group 'cider
   :package-version '(cider . "2.0.0"))
@@ -210,7 +210,7 @@ and use their own fixed formatting."
 The return value is a list (PREFIX CONTINUED-PREFIX POSTFIX) suitable for
 the eval-to-comment handlers."
   (pcase cider-comment-style
-    ('ignore  (list "#_" "" ""))
+    ('discard (list "#_" "" ""))
     ('comment (list "(comment " "" ")"))
     (_        (list cider-comment-prefix
                     cider-comment-continued-prefix
diff --git a/test/cider-eval-tests.el b/test/cider-eval-tests.el
index a92b69f8a6..0d230c119d 100644
--- a/test/cider-eval-tests.el
+++ b/test/cider-eval-tests.el
@@ -182,8 +182,8 @@
           (cider-comment-continued-prefix ";;    ")
           (cider-comment-postfix ""))
       (expect (cider--comment-format) :to-equal '(";; => " ";;    " ""))))
-  (it "wraps results in a reader ignore form for the `ignore' style"
-    (let ((cider-comment-style 'ignore))
+  (it "wraps results in a reader discard form for the `discard' style"
+    (let ((cider-comment-style 'discard))
       (expect (cider--comment-format) :to-equal '("#_" "" ""))))
   (it "wraps results in a comment form for the `comment' style"
     (let ((cider-comment-style 'comment))
@@ -196,7 +196,7 @@
       (let ((indent-line-function #'ignore))
         (cider-maybe-insert-multiline-comment "42" ";; => " ";;    " ""))
       (expect (buffer-string) :to-equal ";; => 42")))
-  (it "produces a reader ignore form for the `ignore' style"
+  (it "produces a reader discard form for the `discard' style"
     (with-temp-buffer
       (let ((indent-line-function #'ignore))
         (cider-maybe-insert-multiline-comment "42" "#_" "" ""))

Reply via email to