Questions tagged [monkey-patching]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
86 views

How do you do runtime code swapping?

Does elisp have the "runtime code swapping" feature? mentioned in slide at 27:14 https://www.youtube.com/watch?v=3TlEqzptWr0&t=27m14s Hot code loading is the art of replacing an engine ...
2
votes
1answer
54 views

Workaround for “Invalid search bound (wrong side of point)” in CC Mode

Emacs 24.x and 25.x have a bug in CC Mode which can result in some operations failing with the error Invalid search bound (wrong side of point) For example, I can reproduce it with the following ...
2
votes
1answer
164 views

How do I temporarily mock a function for testing?

I'd like to patch some elisp functions inside my unit tests. I've tried cl-labels and cl-flet, but neither achieve the result I want: (defun return-number () 1) (defun calls-return-number () (...
5
votes
2answers
162 views

Shallowly override functions within a target function

I'm exploring options for monkey-patching and I'm wondering if the following is within reason. I would like to override a particular function within some target function so that calls within the ...