Skip to content

Instantly share code, notes, and snippets.

@hidsh
Created August 15, 2018 20:57
Show Gist options
  • Save hidsh/a3a6a5764332779f73bbc87d46f17374 to your computer and use it in GitHub Desktop.
Save hidsh/a3a6a5764332779f73bbc87d46f17374 to your computer and use it in GitHub Desktop.
elisp: test of monkey-patching using `letf`
(defun ori ()
"original")
(defun modi ()
"modi")
(ori) ; => "original"
(modi) ; => "modi"
(letf (((symbol-function 'ori)
(symbol-function 'modi)))
(ori)) ; => "modi"
(ori) ; => "original"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment