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?

13 of 24 people (54%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

What's the tip to highlight the syntax with python-mode in emacs?

Aug 16th, 2000 03:38
unknown unknown, Erik Max Francis


Put something like this in your .emacs file:
(setq auto-mode-alist
      (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
      (cons '("python" . python-mode)
            interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python hacking mode." t)
(defun my-python-mode-hook ()
  (setq-default indent-tabs-mode nil)
  )
(add-hook 'python-mode-hook 'my-python-mode-hook)
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)