0

I'm running emacs 27.2 under Linux. I want to totally and completely remove all python-shell-* functions.

I know how to unmap the python-shell-related keymappings, but I want to go further and remove any and all python-shell-* code, as well.

I also know that emacs -q will make sure that python-shell-* code doesn't get loaded, but that is unacceptable to me, because there are other emacs startup functions and code that I want to continue utilizing. I only want to get rid of python-shell-* stuff and nothing else.

Short of manually altering the python.el file which comes with emacs, is there any way to completely disable all python-shell functionality?

Thank you very much in advance.

PS: I want all the rest of the python-mode code to be present.

2
  • You want to load python.el but you want to undefine some of its functions? Just define each of those you want to undefine to definitions that do nothing (or that raise an error, or whatever).
    – Drew
    Dec 28, 2021 at 22:47
  • Yeah, I was thinking about doing that. I was just hoping that there might be some "disable python-shell" functionality that is already built into python.el. But I guess that no such thing exists, so yes, I'll just have to advise all those python-shell-* functions to do nothing.
    – HippoMan
    Dec 28, 2021 at 22:50

1 Answer 1

0

You want to load python.el but you want to undefine some of its functions?

Just define each of those you want to undefine to definitions that do nothing (or that raise an error, or whatever). You can do that by advising those functions with :around advice, or you can just redefine them using defun.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.