Python editing with emacs/wordstar key bindings.

Carl Banks invalidemail at aerojockey.com
Wed Apr 12 20:14:13 EDT 2006


Thomas Bartkus wrote:
> Does anyone use emacs together with both WordStar key bindings and python
> mode?  I'm afraid that Wordstar editing key commands are burned R/O into my
> knuckles!

Old Borland C user?


> I would like to play with emacs for Python editing but I'm having (2)
> problems.
>
>    1) When I load a .py file, emacs automatically overrides my wordstar-mode
> with python-mode, forcing all the keybindings back to emacs native keys.
> Why?
>
> Why should a python-mode care what key bindings are in use?

Python and wordstar are both major modes.  When python-mode is loaded,
it replaces (not sits atop of) wordstar-mode; you can't have two major
modes loaded at the same time.

If you want just want to use wordstar mode, you can prevent Emacs from
loading python mode by putting -*- mode: wordstar -*- on the first line
of the Python file (or second line if it uses a #!).  Or, you could
remove python mode from the auto-mode-alist and interpreter-mode-alists
in your .emacs file, which I leave as an exercise.


>    2) We get <tab> for block indentation instead of the spaces I prefer.

In your .emacs file:

(setq indent-tabs-mode nil)


> Is there a better python-mode script I should be using other than the
> default that came with emacs?

I doubt there's one that solves your problem.


Carl Banks




More information about the Python-list mailing list