I am attempting to modify the python major mode to work slightly differently. Specifically, I would like to change python-indent-region. I believe I have figured out what change I need to make (it involves changing line #1070 to be (beginning-of-line)
). I have tried to change it like that by copying the function into my init.el file and changing that line. However, when I then try to use that function I get the following error:
Lisp error: (void-function python-rx)
I've done some research and it looks like the issue is that python-rx
is actually defined using a defmacro
in python.el. Since python.el is distributed with emacs it is already compiled and seems to reside in /usr/share/emacs/24.5/lisp/progmodes/python.elc
. I was reading about macro compilation here and as I understand it, the macro has been compiled so when I try to reference it it's no longer available.
This comes down to two questions:
- Am I correct in my above understanding?
- How can I accomplish my goal of redefining this function to be mostly the same, despite the fact that it relies on the macro
python-rx
?
Thanks in advance for any help!