Fork me on GitHub
#emacs
<
2019-01-15
>
danielcompton07:01:19

@mpenet yep I like use-package

danielcompton07:01:10

Is there a way in Emacs to rebind a function's definition when calling that function from inside another one?

danielcompton07:01:57

I want to rebind the function call to indent-pp-sexp to my own function

danielcompton07:01:40

but I only want the rebinding to happen when indent-pp-sexp is called from inside custom-save-variables. Is that something you can do with advice?

danielcompton07:01:03

I couldn't see anything that quite fit the bill

narendraj910:01:49

Have you already tried an :around advice with a cl-letf for the function you want to re-bind?

danielcompton10:01:08

Nope, I thought Iā€™d want some kind of replace

danielcompton10:01:18

Or conditional replace

narendraj910:01:17

Adding an advice to custom-save-variables with a cl-letf for indent-pp-sexp should achieve what you are trying to do, I think.

danielcompton10:01:38

Ah, read up a bit more, think I see how it could work

šŸ‘ 5
bozhidar08:01:24

CIDER 0.20 is out https://metaredux.com/posts/2019/01/15/cider-oslo.html Enjoy!

šŸ™Œ 65
parrot 25
šŸš€ 15