;; Python ;; (autoload 'python-mode "python-mode" "python-mode" t) (setq-default py-indent-offset 2) (if hilit (hilit-set-mode-patterns 'python-mode '(("\\s #.*$" nil comment) ("^#.*$" nil comment) ("'''.*\\(\n\.*\\)*'''" nil string) ("\"\"\".*\\(\n\.*\\)*\"\"\"" nil string) ("\"[^\n\\\"]*\\(\\\\.[^\n\\\"]*\\)*\"" nil string) ("'[^\n\\']*\\(\\\\.[^\n\\']*\\)*'" nil string) ("^\\s *import.*$" nil include) ("^\\s *from.*$" nil include) ("^\\s *def\\s +\\(\\w\\|[_']\\)+" nil defun) ("^\\s *class\\s +\\(\\w\\|[_']\\)+" nil decl) ("\\b\\(if\\|else\\|elif\\|for\\|while\\|break\\|continue\\|pass\\|try\\|except\\|raise\\|return\\|in\\|print\\|yield\\|global\\)\\b" nil keyword) )) ) (defvar py-mode-map (make-sparse-keymap)) (define-key py-mode-map "\M-a" 'py-beginning-of-def-or-class) (define-key py-mode-map "\M-e" 'py-end-of-def-or-class)