changeset 80882:e04539d0ccf5

(python-font-lock-keywords, python-open-block-statement-p, python-mode): Add support for the new "with" keyword.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 09 May 2007 16:56:20 +0000
parents 4882ec1204fb
children 0bae4b50536b
files lisp/ChangeLog lisp/progmodes/python.el
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed May 09 16:53:13 2007 +0000
+++ b/lisp/ChangeLog	Wed May 09 16:56:20 2007 +0000
@@ -1,3 +1,9 @@
+2007-05-09  Edward O'Connor  <hober0@gmail.com>  (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-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* diff-mode.el (diff-apply-hunk, diff-test-hunk): Don't do by default
--- a/lisp/progmodes/python.el	Wed May 09 16:53:13 2007 +0000
+++ b/lisp/progmodes/python.el	Wed May 09 16:56:20 2007 +0000
@@ -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 @@
   (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)
@@ -2239,7 +2239,7 @@
        #'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)