branch: elpa/cider commit ea49f85e435dcb5edd12210c8c42e91c1cfa7083 Author: yuhan0 <qyth...@gmail.com> Commit: Bozhidar Batsov <bozhi...@batsov.dev>
Move undef commands to cider-eval.el to satisfy the byte compiler --- cider-eval.el | 21 +++++++++++++++++++++ cider-mode.el | 21 --------------------- cider-repl.el | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cider-eval.el b/cider-eval.el index edcd184d08..e7c6e77fd6 100644 --- a/cider-eval.el +++ b/cider-eval.el @@ -1374,6 +1374,27 @@ passing arguments." (kill-new (nrepl-dict-get (cider-nrepl-sync-request:eval "*1") "value"))) +(defun cider-undef () + "Undefine a symbol from the current ns." + (interactive) + (cider-ensure-op-supported "undef") + (cider-read-symbol-name + "Undefine symbol: " + (lambda (sym) + (cider-nrepl-send-request + `("op" "undef" + "ns" ,(cider-current-ns) + "sym" ,sym) + (cider-interactive-eval-handler (current-buffer)))))) + +(defun cider-undef-all (&optional ns) + "Undefine all symbols and aliases from the namespace NS." + (interactive) + (cider-ensure-op-supported "undef-all") + (cider-nrepl-send-sync-request + `("op" "undef-all" + "ns" ,(or ns (cider-current-ns))))) + ;; Eval keymaps (defvar cider-eval-pprint-commands-map (let ((map (define-prefix-command 'cider-eval-pprint-commands-map))) diff --git a/cider-mode.el b/cider-mode.el index b47d8e4c49..71b6ac1f97 100644 --- a/cider-mode.el +++ b/cider-mode.el @@ -158,27 +158,6 @@ the related commands `cider-repl-clear-buffer' and (cider-repl-clear-output)) (switch-to-buffer origin-buffer))) -(defun cider-undef () - "Undefine a symbol from the current ns." - (interactive) - (cider-ensure-op-supported "undef") - (cider-read-symbol-name - "Undefine symbol: " - (lambda (sym) - (cider-nrepl-send-request - `("op" "undef" - "ns" ,(cider-current-ns) - "sym" ,sym) - (cider-interactive-eval-handler (current-buffer)))))) - -(defun cider-undef-all (&optional ns) - "Undefine all symbols and aliases from the namespace NS." - (interactive) - (cider-ensure-op-supported "undef-all") - (cider-nrepl-send-sync-request - `("op" "undef-all" - "ns" ,(or ns (cider-current-ns))))) - ;;; cider-run (defvar cider--namespace-history nil "History of user input for namespace prompts.") diff --git a/cider-repl.el b/cider-repl.el index d9fcdfadeb..8516159200 100644 --- a/cider-repl.el +++ b/cider-repl.el @@ -1575,7 +1575,7 @@ constructs." (puthash name handler cider-repl-shortcuts)) (declare-function cider-toggle-trace-ns "cider-tracing") -(declare-function cider-undef "cider-mode") +(declare-function cider-undef "cider-eval") (declare-function cider-browse-ns "cider-browse-ns") (declare-function cider-classpath "cider-classpath") (declare-function cider-repl-history "cider-repl-history")