faqts : Computers : Programming : Languages : Python : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 6 people (100%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

Is it possible to configure emacs so that it automatically starts in python mode when opening a file *.py?

Jun 23rd, 2000 23:49
unknown unknown, Piet van Oostrum


You do this in the standard emacs way:

(setq auto-mode-alist
      (cons '("\\.pyw?$" . python-mode) auto-mode-alist))

or

(add-to-list 'auto-mode-alist '("\\.pyw?$" . python-mode))

It is also useful (at least on Unix) to have

(add-to-list 'interpreter-mode-alist '("python" . python-mode))