emacs with python mode

Jeff Bauer jbauer at rubic.com
Thu Aug 26 09:27:43 EDT 1999


"Gerhard W. Gruber" wrote:
> I'm using Xemacs 21.0 Beta (August 1998) on Win32 and it works quite
> fine (is there a newer version out there?). Now my real question. When
> I'm using Python emacs recognices the mode but it doesn't automatically
> activate syntax highlighting, 

Gerhard,

I'm not very knowledgable about emacs, but I'm using
XEmacs on NT for Python editing.  Below are some settings
in my home .emacs that you might find useful.

I also find it useful to swap my CONTROL and CAPLOCKS
keys for Emacs editing on Windows machines.  Check out 
Gordon Chaffee's home page for his swapkeys utility:

  http://bmrc.berkeley.edu/people/chaffee/

-Jeff Bauer
---

;; Jeff - add ~/elisp to my load-path
(setq load-path (cons "d:/jbauer/elisp/" load-path))

;; Jeff - almost everything below this point is stuff I've modified
(setq-default indent-tabs-mode nil)
(setq make-backup-files nil)
(setq line-number-mode t)
(setq default-tab-width 4)
(setq-default case-replace nil)  ; never modify case when replacing
(setq scroll-step 2)

;; highlight the region between point and mark
(setq transient-mark-mode t)

;; Python file associations
(add-hook 'python-mode-hook 'turn-on-font-lock)
(setq auto-mode-alist
      (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
      (cons '("python" . python-mode)
	    interpreter-mode-alist))

;; Autoload python
(autoload 'python-mode "python-mode" "Python editing mode." t)

(cond ((fboundp 'global-font-lock-mode)
       ;; Turn on font-lock in all modes that support it
       (global-font-lock-mode t)
       ;; Maximum colors
       (setq font-lock-maximum-decoration t)))




More information about the Python-list mailing list