FIX check if lein is installed before calling cider deps

This commit is contained in:
Nathan Dwarshuis 2021-03-13 21:50:47 -05:00
parent 5d2d44f8ce
commit 0556d0fc3a
1 changed files with 36 additions and 32 deletions

View File

@ -4349,21 +4349,23 @@ Since I use vi mode in my terminal emulator, need to preserve the escape key's r
#+end_src #+end_src
**** cider **** cider
#+begin_src emacs-lisp #+begin_src emacs-lisp
(evil-define-key '(normal insert) cider-repl-mode-map (nd/when-bin "lein"
(kbd "C-k") 'cider-repl-previous-input :pacman "leiningen"
(kbd "C-j") 'cider-repl-next-input) (evil-define-key '(normal insert) cider-repl-mode-map
(kbd "C-k") 'cider-repl-previous-input
(kbd "C-j") 'cider-repl-next-input)
(evil-define-key 'normal cider-repl-mode-map (evil-define-key 'normal cider-repl-mode-map
"gh" #'lispy-left "gh" #'lispy-left
"gl" #'lispy-flow "gl" #'lispy-flow
"gj" #'lispy-down "gj" #'lispy-down
"gk" #'lispy-up) "gk" #'lispy-up)
(evil-define-key 'normal cider-mode-map (evil-define-key 'normal cider-mode-map
"gh" #'lispy-left "gh" #'lispy-left
"gl" #'lispy-flow "gl" #'lispy-flow
"gj" #'lispy-down "gj" #'lispy-down
"gk" #'lispy-up) "gk" #'lispy-up))
#+end_src #+end_src
** local ** local
These are for mode-specific bindings that can/should be outside of the evil maps above (there are not many, and these may be merged with their evil bretheren in the future). These are for mode-specific bindings that can/should be outside of the evil maps above (there are not many, and these may be merged with their evil bretheren in the future).
@ -4494,29 +4496,31 @@ They removed the underscore-inserts-arrow feature. Bring it back.
#+END_SRC #+END_SRC
*** clojure *** clojure
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'cider-connection) (nd/when-bin "lein"
:pacman "leiningen"
(require 'cider-connection)
(defun nd/cider-switch-to-repl-or-start (&optional set-ns) (defun nd/cider-switch-to-repl-or-start (&optional set-ns)
"Switch to CIDER REPL or start a new one if none." "Switch to CIDER REPL or start a new one if none."
(interactive "P") (interactive "P")
(if (cider-current-repl) (if (cider-current-repl)
(cider-switch-to-repl-buffer set-ns) (cider-switch-to-repl-buffer set-ns)
(message "Starting New REPL") (message "Starting New REPL")
(cider-jack-in nil))) (cider-jack-in nil)))
(with-eval-after-load 'clojure-mode (with-eval-after-load 'clojure-mode
(nd/hydra-standard-int clojure-mode-map (nd/hydra-standard-int clojure-mode-map
(:send-group . cider-eval-sexp-at-point) (:send-group . cider-eval-sexp-at-point)
(:send-buffer . cider-eval-buffer) (:send-buffer . cider-eval-buffer)
(:shell-start . nd/cider-switch-to-repl-or-start) (:shell-start . nd/cider-switch-to-repl-or-start)
(:shell-kill . cider-quit)) (:shell-kill . cider-quit))
(nd/hydra-standard-nav clojure-mode-map (nd/hydra-standard-nav clojure-mode-map
(:doc-at . cider-doc))) (:doc-at . cider-doc)))
(with-eval-after-load 'cider-repl-mode (with-eval-after-load 'cider-repl-mode
(nd/hydra-standard-int cider-repl-mode-map (nd/hydra-standard-int cider-repl-mode-map
(:shell-kill . cider-quit))) (:shell-kill . cider-quit))))
#+end_src #+end_src
*** python *** python
:PROPERTIES: :PROPERTIES: