I use an Emacs mode to annotate some of my files (the actual mode is not important). It's supplied as a library and comes with compiled lisp code (of course). I want to modify its behavior by overriding a single function in it. Just for my local Emacs session. For now, I just copy-paste the function from the library's source file, modify it a bit, then hit eval-last-sexp
. So far, so good. However, I get inconsistent results: I'm not sure how Emacs handles functions coming from .elc
files mixed with functions coming from source. Sometimes I see my own version of the function running, sometimes the original version. Very confusing (and annoying).
Any ideas how can I consistently replace a lisp function in an Emacs library without modifying the library's source files which are read-only?