spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
prnc 2020-12-26T13:39:29.258300Z

since “tap> is the new print” 😜 are there any helper fns in cider or clojure mode for tapping? (e.g. like there are for pretty printing)?

practicalli-john 2020-12-26T13:44:32.258400Z

I am not aware of any cider commands for tap>. I tend to use cider-inspect rather than tap when using Emacs

prnc 2020-12-26T13:50:31.258600Z

thanks!

practicalli-john 2020-12-26T15:48:21.258800Z

I assume it wouldn't be too difficult to write some. I believe you can write a bit of elisp to call Clojure code and then bind that in an interactive function to a key

practicalli-john 2020-12-26T15:52:37.259Z

I have just been using a rich comment block to call tap functions for now. https://github.com/practicalli/scicloj-notespace-simple-demo/blob/live/src/practicalli/notespace_demo.clj#L145 I also use a user.clj to run the portal data browser and add it as a tap source. There is an example in the dev/user.clj file in the repository above

prnc 2020-12-26T16:56:13.259300Z

Thanks @jr0cket. I use the cider inspector as well, but sometimes things like portal etc. can come in handy. I’ve ended up doing this:

prnc 2020-12-26T16:56:26.259500Z

(defun prnc/clojure-eval-tap ()
    (interactive)
    (cider-interactive-eval
     (format "(tap> %s)"
             (apply #'buffer-substring-no-properties
                    (cider-last-sexp 'bounds)))))
  (spacemacs/set-leader-keys-for-major-mode 'clojure-mode (kbd "et") 'prnc/clojure-eval-tap)

👍 1
prnc 2020-12-26T16:56:56.259700Z

as a quick hack to see if I like this workflow