Skip to content

Commit ea49f85

Browse files
yuhan0bbatsov
authored andcommitted
Move undef commands to cider-eval.el
to satisfy the byte compiler
1 parent e450d1e commit ea49f85

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

cider-eval.el

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,27 @@ passing arguments."
13741374
(kill-new
13751375
(nrepl-dict-get (cider-nrepl-sync-request:eval "*1") "value")))
13761376

1377+
(defun cider-undef ()
1378+
"Undefine a symbol from the current ns."
1379+
(interactive)
1380+
(cider-ensure-op-supported "undef")
1381+
(cider-read-symbol-name
1382+
"Undefine symbol: "
1383+
(lambda (sym)
1384+
(cider-nrepl-send-request
1385+
`("op" "undef"
1386+
"ns" ,(cider-current-ns)
1387+
"sym" ,sym)
1388+
(cider-interactive-eval-handler (current-buffer))))))
1389+
1390+
(defun cider-undef-all (&optional ns)
1391+
"Undefine all symbols and aliases from the namespace NS."
1392+
(interactive)
1393+
(cider-ensure-op-supported "undef-all")
1394+
(cider-nrepl-send-sync-request
1395+
`("op" "undef-all"
1396+
"ns" ,(or ns (cider-current-ns)))))
1397+
13771398
;; Eval keymaps
13781399
(defvar cider-eval-pprint-commands-map
13791400
(let ((map (define-prefix-command 'cider-eval-pprint-commands-map)))

cider-mode.el

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -158,27 +158,6 @@ the related commands `cider-repl-clear-buffer' and
158158
(cider-repl-clear-output))
159159
(switch-to-buffer origin-buffer)))
160160

161-
(defun cider-undef ()
162-
"Undefine a symbol from the current ns."
163-
(interactive)
164-
(cider-ensure-op-supported "undef")
165-
(cider-read-symbol-name
166-
"Undefine symbol: "
167-
(lambda (sym)
168-
(cider-nrepl-send-request
169-
`("op" "undef"
170-
"ns" ,(cider-current-ns)
171-
"sym" ,sym)
172-
(cider-interactive-eval-handler (current-buffer))))))
173-
174-
(defun cider-undef-all (&optional ns)
175-
"Undefine all symbols and aliases from the namespace NS."
176-
(interactive)
177-
(cider-ensure-op-supported "undef-all")
178-
(cider-nrepl-send-sync-request
179-
`("op" "undef-all"
180-
"ns" ,(or ns (cider-current-ns)))))
181-
182161
;;; cider-run
183162
(defvar cider--namespace-history nil
184163
"History of user input for namespace prompts.")

cider-repl.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ constructs."
15751575
(puthash name handler cider-repl-shortcuts))
15761576

15771577
(declare-function cider-toggle-trace-ns "cider-tracing")
1578-
(declare-function cider-undef "cider-mode")
1578+
(declare-function cider-undef "cider-eval")
15791579
(declare-function cider-browse-ns "cider-browse-ns")
15801580
(declare-function cider-classpath "cider-classpath")
15811581
(declare-function cider-repl-history "cider-repl-history")

0 commit comments

Comments
 (0)