From 0556d0fc3acc75487b0b3b924874aa4763a76717 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 13 Mar 2021 21:50:47 -0500 Subject: [PATCH] FIX check if lein is installed before calling cider deps --- etc/conf.org | 68 +++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/etc/conf.org b/etc/conf.org index 56dd8d8..f4e8d11 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -4349,21 +4349,23 @@ Since I use vi mode in my terminal emulator, need to preserve the escape key's r #+end_src **** cider #+begin_src emacs-lisp -(evil-define-key '(normal insert) cider-repl-mode-map - (kbd "C-k") 'cider-repl-previous-input - (kbd "C-j") 'cider-repl-next-input) +(nd/when-bin "lein" + :pacman "leiningen" + (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 - "gh" #'lispy-left - "gl" #'lispy-flow - "gj" #'lispy-down - "gk" #'lispy-up) + (evil-define-key 'normal cider-repl-mode-map + "gh" #'lispy-left + "gl" #'lispy-flow + "gj" #'lispy-down + "gk" #'lispy-up) -(evil-define-key 'normal cider-mode-map - "gh" #'lispy-left - "gl" #'lispy-flow - "gj" #'lispy-down - "gk" #'lispy-up) + (evil-define-key 'normal cider-mode-map + "gh" #'lispy-left + "gl" #'lispy-flow + "gj" #'lispy-down + "gk" #'lispy-up)) #+end_src ** 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). @@ -4494,29 +4496,31 @@ They removed the underscore-inserts-arrow feature. Bring it back. #+END_SRC *** clojure #+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) - "Switch to CIDER REPL or start a new one if none." - (interactive "P") - (if (cider-current-repl) - (cider-switch-to-repl-buffer set-ns) - (message "Starting New REPL") - (cider-jack-in nil))) + (defun nd/cider-switch-to-repl-or-start (&optional set-ns) + "Switch to CIDER REPL or start a new one if none." + (interactive "P") + (if (cider-current-repl) + (cider-switch-to-repl-buffer set-ns) + (message "Starting New REPL") + (cider-jack-in nil))) -(with-eval-after-load 'clojure-mode - (nd/hydra-standard-int clojure-mode-map - (:send-group . cider-eval-sexp-at-point) - (:send-buffer . cider-eval-buffer) - (:shell-start . nd/cider-switch-to-repl-or-start) - (:shell-kill . cider-quit)) + (with-eval-after-load 'clojure-mode + (nd/hydra-standard-int clojure-mode-map + (:send-group . cider-eval-sexp-at-point) + (:send-buffer . cider-eval-buffer) + (:shell-start . nd/cider-switch-to-repl-or-start) + (:shell-kill . cider-quit)) - (nd/hydra-standard-nav clojure-mode-map - (:doc-at . cider-doc))) + (nd/hydra-standard-nav clojure-mode-map + (:doc-at . cider-doc))) -(with-eval-after-load 'cider-repl-mode - (nd/hydra-standard-int cider-repl-mode-map - (:shell-kill . cider-quit))) + (with-eval-after-load 'cider-repl-mode + (nd/hydra-standard-int cider-repl-mode-map + (:shell-kill . cider-quit)))) #+end_src *** python :PROPERTIES: