Disabling Python-mode’s skeletons

One of the few things I dislike about Emacs 23 is the new behavior of python-mode. When you type things like def, it expands these into snippets using abbrev-mode. I don’t like this because I have similar functionality by way of yasnippet.

I prefer the yasnippet way because it uses fields in the snippet. The default way prompts you for values in the minibuffer with read-string, which I dislike. It also overrides my preferred behavior, and there’s no option to disable it.

Of course, there’s always a way in Emacs, and it can be removed with this code:

(let (python-mode-abbrev-table)
  (require 'python))

Which is simple and works, though I dislike it. I prefer to tweak behaviors with eval-after-load, since requires can be slow. Unfortunately, by the time that code executes, the damage is done.

I’ll update if I find a better way to fix it.

2009/01/24
Previously On Atomized:

Discussion

Thanks – just what I was looking for!

Eoghan Murray
2009/03/02

[...] if you use yasnippet for templates you may also find interesting Ian Eure’s post about Disabling Python-mode’s skeletons would be also very [...]

python and emacs: the rope way at rlazo's blog
2010/01/22

Participate