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

    Tidy the REPL keymap: C-c M-m parity, drop the refactor map
    
    Two leftovers from copying cider-mode's bindings into the REPL:
    
    - `C-c M-m' still ran `cider-macroexpand-all' directly, while `cider-mode'
      moved it to the `cider-macroexpand-menu' transient - so the same key did
      different things in a source buffer and in the REPL.  Point the REPL at 
the
      menu too.
    - `C-c C-r' bound clojure-mode's source-editing refactor map (sort-ns,
      insert-ns-form, introduce-let, ...), which is meaningless at a prompt and 
is
      injected only here.  Drop it.
---
 lisp/cider-repl.el       | 4 ++--
 test/cider-repl-tests.el | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/cider-repl.el b/lisp/cider-repl.el
index 1e47f4f5be..0cd8a2c4d7 100644
--- a/lisp/cider-repl.el
+++ b/lisp/cider-repl.el
@@ -2268,6 +2268,7 @@ in an unexpected place."
 (declare-function cider-switch-to-last-clojure-buffer "cider-mode")
 (declare-function cider-macroexpand-1 "cider-macroexpansion")
 (declare-function cider-macroexpand-all "cider-macroexpansion")
+(declare-function cider-macroexpand-menu "cider-macroexpansion")
 (declare-function cider-selector "cider-selector")
 (declare-function cider-jack-in-clj "cider")
 (declare-function cider-jack-in-cljs "cider")
@@ -2305,7 +2306,7 @@ in an unexpected place."
     (define-key map (kbd "C-c C-b") #'cider-interrupt)
     (define-key map (kbd "C-c C-c") #'cider-interrupt)
     (define-key map (kbd "C-c C-m") #'cider-macroexpand-1)
-    (define-key map (kbd "C-c M-m") #'cider-macroexpand-all)
+    (define-key map (kbd "C-c M-m") #'cider-macroexpand-menu)
     (define-key map (kbd "C-c C-s") #'sesman-map)
     (define-key map (kbd "C-c C-z") #'cider-switch-to-last-clojure-buffer)
     (define-key map (kbd "C-c M-o") #'cider-repl-switch-to-other)
@@ -2317,7 +2318,6 @@ in an unexpected place."
     (define-key map (kbd "C-c M-p") #'cider-history)
     (define-key map (kbd "C-c M-t") #'cider-trace-menu)
     (define-key map (kbd "C-c C-x") #'cider-start-menu)
-    (define-key map (kbd "C-c C-r") 'clojure-refactor-map)
     ;; Shadow the global `eval-last-sexp' (Emacs Lisp) so `C-x C-e' is an
     ;; explicit no-op in the REPL rather than evaluating the Clojure text as
     ;; Emacs Lisp.  Evaluate at the prompt instead.
diff --git a/test/cider-repl-tests.el b/test/cider-repl-tests.el
index bfc4ce5c7a..ba291070cf 100644
--- a/test/cider-repl-tests.el
+++ b/test/cider-repl-tests.el
@@ -791,6 +791,12 @@ PROPERTY should be a symbol of either 'text, 'ansi-context 
or
     (expect (lookup-key cider-repl-mode-map (kbd "C-x C-e")) :to-be 'undefined)
     (expect (lookup-key cider-repl-mode-map (kbd "C-c C-v")) :to-be nil))
 
+  (it "does not inject clojure-mode's source-editing refactor map"
+    (expect (lookup-key cider-repl-mode-map (kbd "C-c C-r")) :to-be nil))
+
   (it "keeps the macroexpand and inspect commands"
     (expect (lookup-key cider-repl-mode-map (kbd "C-c C-m")) :to-be 
'cider-macroexpand-1)
-    (expect (lookup-key cider-repl-mode-map (kbd "C-c M-i")) :to-be 
'cider-inspect)))
+    (expect (lookup-key cider-repl-mode-map (kbd "C-c M-i")) :to-be 
'cider-inspect))
+
+  (it "binds C-c M-m to the macroexpand menu, matching cider-mode"
+    (expect (lookup-key cider-repl-mode-map (kbd "C-c M-m")) :to-be 
'cider-macroexpand-menu)))

Reply via email to