aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorStefan Monnier2007-05-10 17:39:27 +0000
committerStefan Monnier2007-05-10 17:39:27 +0000
commit52319b0e590efc71ad991b007015a1d10cb6719d (patch)
tree8e740e8a7a69545a04a6201784586ea12cb3a4c1 /lisp/progmodes/python.el
parentdd5983667ceb93fca27b7990641c49e342caa7c6 (diff)
downloademacs-52319b0e590efc71ad991b007015a1d10cb6719d.tar.gz
emacs-52319b0e590efc71ad991b007015a1d10cb6719d.zip
(python-font-lock-keywords, python-open-block-statement-p, python-mode):
Add support for the new "with" keyword.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 17d30e0d972..cc8c44a4676 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -96,7 +96,7 @@
96 "import" "in" "is" "lambda" "not" "or" "pass" "print" 96 "import" "in" "is" "lambda" "not" "or" "pass" "print"
97 "raise" "return" "try" "while" "yield" 97 "raise" "return" "try" "while" "yield"
98 ;; Future keywords 98 ;; Future keywords
99 "as" "None" 99 "as" "None" "with"
100 ;; Not real keywords, but close enough to be fontified as such 100 ;; Not real keywords, but close enough to be fontified as such
101 "self" "True" "False") 101 "self" "True" "False")
102 symbol-end) 102 symbol-end)
@@ -374,7 +374,7 @@ BOS non-nil means point is known to be at beginning of statement."
374 (save-excursion 374 (save-excursion
375 (unless bos (python-beginning-of-statement)) 375 (unless bos (python-beginning-of-statement))
376 (looking-at (rx (and (or "if" "else" "elif" "while" "for" "def" 376 (looking-at (rx (and (or "if" "else" "elif" "while" "for" "def"
377 "class" "try" "except" "finally") 377 "class" "try" "except" "finally" "with")
378 symbol-end))))) 378 symbol-end)))))
379 379
380(defun python-close-block-statement-p (&optional bos) 380(defun python-close-block-statement-p (&optional bos)
@@ -2240,7 +2240,7 @@ with skeleton expansions for compound statement templates.
2240 #'python-current-defun) 2240 #'python-current-defun)
2241 (set (make-local-variable 'outline-regexp) 2241 (set (make-local-variable 'outline-regexp)
2242 (rx (* space) (or "class" "def" "elif" "else" "except" "finally" 2242 (rx (* space) (or "class" "def" "elif" "else" "except" "finally"
2243 "for" "if" "try" "while") 2243 "for" "if" "try" "while" "with")
2244 symbol-end)) 2244 symbol-end))
2245 (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n") 2245 (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n")
2246 (set (make-local-variable 'outline-level) #'python-outline-level) 2246 (set (make-local-variable 'outline-level) #'python-outline-level)