summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-07-05 20:11:35 (GMT)
committerBarry Warsaw <barry@python.org>1996-07-05 20:11:35 (GMT)
commit44b7220b8bac090b21ff6de0944bd6115d54b679 (patch)
tree130ec46254e7843f02832af073d6e7226d6e27a3 /Misc
parent8e9d7d7e83d214411907f26b44c116f4349095f8 (diff)
downloadcpython-44b7220b8bac090b21ff6de0944bd6115d54b679.zip
cpython-44b7220b8bac090b21ff6de0944bd6115d54b679.tar.gz
cpython-44b7220b8bac090b21ff6de0944bd6115d54b679.tar.bz2
(python-font-lock-keywords): added class and def
Diffstat (limited to 'Misc')
-rw-r--r--Misc/python-mode.el20
1 files changed, 13 insertions, 7 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 31cd352..96600c4 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -38,6 +38,11 @@
;; (autoload 'python-mode "python-mode" "Python editing mode." t)
;; (setq auto-mode-alist
;; (cons '("\\.py$" . python-mode) auto-mode-alist))
+;;
+;; If you want font-lock support for Python source code (a.k.a. syntax
+;; coloring, highlighting), add this to your .emacs file:
+;;
+;; (add-hook 'python-mode-hook 'turn-on-font-lock)
;; Here's a brief list of recent additions/improvements:
;;
@@ -189,13 +194,14 @@ displayed in the echo area, and if `py-beep-if-tab-change' is non-nil
the Emacs bell is also rung as a warning.")
(defconst python-font-lock-keywords
- (let* ((keywords '("access" "and" "break" "continue"
- "del" "elif" "else:" "except"
- "except:" "exec" "finally:" "for"
- "from" "global" "if" "import"
- "in" "is" "lambda" "not"
- "or" "pass" "print" "raise"
- "return" "try:" "while"
+ (let* ((keywords '("access" "and" "break" "class"
+ "continue" "def" "del" "elif"
+ "else:" "except" "except:" "exec"
+ "finally:" "for" "from" "global"
+ "if" "import" "in" "is"
+ "lambda" "not" "or" "pass"
+ "print" "raise" "return" "try:"
+ "while"
))
(kwregex (mapconcat 'identity keywords "\\|")))
(list