# HG changeset patch # User Stefan Monnier # Date 1178818767 0 # Node ID 0b0c0f93563ce17d6b4b93fbe514fcbf88492bd3 # Parent 861b8417e14839f5577b9f806aae125fc720496d (python-font-lock-keywords, python-open-block-statement-p, python-mode): Add support for the new "with" keyword. diff -r 861b8417e148 -r 0b0c0f93563c lisp/ChangeLog --- a/lisp/ChangeLog Thu May 10 16:39:46 2007 +0000 +++ b/lisp/ChangeLog Thu May 10 17:39:27 2007 +0000 @@ -1,3 +1,9 @@ +2007-05-10 Edward O'Connor (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 * international/iso-cvt.el (iso-cvt-read-only): Ignore arguments. diff -r 861b8417e148 -r 0b0c0f93563c lisp/progmodes/python.el --- a/lisp/progmodes/python.el Thu May 10 16:39:46 2007 +0000 +++ b/lisp/progmodes/python.el Thu May 10 17:39:27 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) @@ -2240,7 +2240,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)