aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-05-09 16:56:20 +0000
committerStefan Monnier2007-05-09 16:56:20 +0000
commit0b480dc77303bd9de41ee7b90a9b2e133712a25c (patch)
tree52f74a24b824a8f662c3d3d7c7d8b4adfe36d082
parent0f21ecf3c59d4ad711f27384d144c7da834ff20a (diff)
downloademacs-0b480dc77303bd9de41ee7b90a9b2e133712a25c.tar.gz
emacs-0b480dc77303bd9de41ee7b90a9b2e133712a25c.zip
(python-font-lock-keywords, python-open-block-statement-p, python-mode):
Add support for the new "with" keyword.
-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 f89d2562d99..9f519f688e1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12007-05-09 Edward O'Connor <hober0@gmail.com> (tiny change)
2
3 * progmodes/python.el (python-font-lock-keywords)
4 (python-open-block-statement-p, python-mode): Add support for the new
5 "with" keyword.
6
12007-05-08 Stefan Monnier <monnier@iro.umontreal.ca> 72007-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * diff-mode.el (diff-apply-hunk, diff-test-hunk): Don't do by default 9 * diff-mode.el (diff-apply-hunk, diff-test-hunk): Don't do by default
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index f45b144779c..d2e913f2315 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)
@@ -2239,7 +2239,7 @@ with skeleton expansions for compound statement templates.
2239 #'python-current-defun) 2239 #'python-current-defun)
2240 (set (make-local-variable 'outline-regexp) 2240 (set (make-local-variable 'outline-regexp)
2241 (rx (* space) (or "class" "def" "elif" "else" "except" "finally" 2241 (rx (* space) (or "class" "def" "elif" "else" "except" "finally"
2242 "for" "if" "try" "while") 2242 "for" "if" "try" "while" "with")
2243 symbol-end)) 2243 symbol-end))
2244 (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n") 2244 (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n")
2245 (set (make-local-variable 'outline-level) #'python-outline-level) 2245 (set (make-local-variable 'outline-level) #'python-outline-level)