]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(python-font-lock-keywords): new variable
authorBarry Warsaw <barry@python.org>
Wed, 8 Mar 1995 22:02:44 +0000 (22:02 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 8 Mar 1995 22:02:44 +0000 (22:02 +0000)
Misc/python-mode.el

index 84be62ec9478b763b756b6b93869c2a96dcf8581..06656cc76b2d9ddc68cbb0ee2dc37e2b46c503aa 100644 (file)
@@ -165,6 +165,33 @@ equal <number>, `tab-width' is set to <number>, a message saying so is
 displayed in the echo area, and if `py-beep-if-tab-change' is non-nil
 the Emacs bell is also rung as a warning.")
 
+(defvar python-font-lock-keywords
+  (purecopy
+   (list
+    (cons
+     (concat
+      "\\<\\("
+      (mapconcat
+       'identity
+       '(
+        "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"
+        )
+       "\\|")
+      "\\)\\>")
+     1)
+    ;; functions
+    '("\\bdef\\s +\\(\\sw+\\)(" 1 font-lock-function-name-face)
+    ;; classes
+    '("\\bclass\\s +\\(\\sw+\\)[(:]" 1 font-lock-function-name-face)
+    )
+   "*Additional keywords to highlight `python-mode' buffers."))
 
 \f
 ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^