aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2007-05-10 17:39:27 +0000
committerStefan Monnier <[email protected]>2007-05-10 17:39:27 +0000
commit52319b0e590efc71ad991b007015a1d10cb6719d (patch)
tree8e740e8a7a69545a04a6201784586ea12cb3a4c1 /lisp
parentdd5983667ceb93fca27b7990641c49e342caa7c6 (diff)
(python-font-lock-keywords, python-open-block-statement-p, python-mode):
Add support for the new "with" keyword.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/python.el6
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 302179843b..74870e8fe7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-10 Edward O'Connor <[email protected]> (tiny change)
+
+ * progmodes/python.el (python-font-lock-keywords)
+ (python-open-block-statement-p, python-mode): Add support for the new
+ "with" keyword.
+
2007-05-10 Richard Stallman <[email protected]>
* international/iso-cvt.el (iso-cvt-read-only): Ignore arguments.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 17d30e0d97..cc8c44a467 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -96,7 +96,7 @@
"import" "in" "is" "lambda" "not" "or" "pass" "print"
"raise" "return" "try" "while" "yield"
;; Future keywords
- "as" "None"
+ "as" "None" "with"
;; Not real keywords, but close enough to be fontified as such
"self" "True" "False")
symbol-end)
@@ -374,7 +374,7 @@ BOS non-nil means point is known to be at beginning of statement."
(save-excursion
(unless bos (python-beginning-of-statement))
(looking-at (rx (and (or "if" "else" "elif" "while" "for" "def"
- "class" "try" "except" "finally")
+ "class" "try" "except" "finally" "with")
symbol-end)))))
(defun python-close-block-statement-p (&optional bos)
@@ -2240,7 +2240,7 @@ with skeleton expansions for compound statement templates.
#'python-current-defun)
(set (make-local-variable 'outline-regexp)
(rx (* space) (or "class" "def" "elif" "else" "except" "finally"
- "for" "if" "try" "while")
+ "for" "if" "try" "while" "with")
symbol-end))
(set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n")
(set (make-local-variable 'outline-level) #'python-outline-level)