Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tap> to cider eval #3094

Closed
archaic opened this issue Nov 25, 2021 · 5 comments
Closed

Add tap> to cider eval #3094

archaic opened this issue Nov 25, 2021 · 5 comments

Comments

@archaic
Copy link

archaic commented Nov 25, 2021

Hello, I have got the functionality that I wanted using the code below.
I don't know emacs lisp very well, so I thought I would post it here for suggestions,
improvements or if anyone else wanted to use it. Everything I eval gets tapped
(for use with add-taps such as portal)

(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)

@bbatsov
Copy link
Member

bbatsov commented Dec 31, 2021

See also #3055 for a different approach to doing this.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale label Apr 17, 2022
@daslu
Copy link
Contributor

daslu commented May 5, 2022

@archaic this code example has been extremely useful to me!

@bbatsov
Copy link
Member

bbatsov commented Aug 23, 2022

We'll likely merge a limited version of this as proposed in #3239. We can still include @archaic's code snippet in the evaluation docs, though, so it's easy for people to discover it.

@vemv
Copy link
Member

vemv commented Oct 28, 2023

Between #3240, 966cae4 and the future #3055 our tapping needs will be well-served.

The (advice-add 'cider-nrepl-request:eval :filter-args #'cider-tap) is nice but a productionized approach would look like nREPL middleware instead.

Cheers - V

@vemv vemv closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants