Fork me on GitHub
Pragyan Tripathi03:01:46

Just in case anyone needs it. I was able to send all evals in doom-emacs to portal for visualization. Just paste following config in your config.el

defun portal.api/open ()
   "(require 'portal.api) (portal.api/tap) (portal.api/open)"))

(defun portal.api/clear ()
  (cider-nrepl-sync-request:eval "(portal.api/clear)"))

(defun portal.api/close ()
  (cider-nrepl-sync-request:eval "(portal.api/close)"))

;; Example key mappings for doom emacs
(map! :map clojure-mode-map
      ;; cmd  + o
      :n "s-o" #'portal.api/open
      ;; ctrl + l
      :n "C-l" #'portal.api/clear)

(require 'cider-mode)

(defun cider-tap (&rest r)
  (cons (concat "(let [__value "
                (caar r)
                "] (tap> __value) __value)")
        (cdar r)))

(advice-add 'cider-nrepl-request:eval
            :filter-args #'cider-tap)

🎉 5
Brian Chevalier03:01:10

Thanks for sharing!