Overwrite function in vterm module

I want to overwrite the +vterm--configure-project-root-and-display function of the vterm module. I tried to do that with:

(after! vterm
        (defun +vterm--configure-project-root-and-display (arg display-fn)
                (message "worked")))

With that when I restart doom emacs and then press SPC o t, the terminal pops up as usual. Only when I press SPC o t for the second time, I just get the “worked” message.

So I guess the issue here is that the after hook triggers, but only after the function is used for the first time. Is there some way to ensure the function is overwritten?

Note that advices will probably not work in this case since my changes are non-trivial.

Advice is what you need, use an :override advice.

Exactly what I needed. Thank you!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.