mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-12 09:00:40 -08:00
(python-font-lock-keywords, python-open-block-statement-p, python-mode):
Add support for the new "with" keyword.
This commit is contained in:
parent
0f21ecf3c5
commit
0b480dc773
2 changed files with 9 additions and 3 deletions
|
|
@ -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>
|
2007-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||||
|
|
||||||
* diff-mode.el (diff-apply-hunk, diff-test-hunk): Don't do by default
|
* diff-mode.el (diff-apply-hunk, diff-test-hunk): Don't do by default
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@
|
||||||
"import" "in" "is" "lambda" "not" "or" "pass" "print"
|
"import" "in" "is" "lambda" "not" "or" "pass" "print"
|
||||||
"raise" "return" "try" "while" "yield"
|
"raise" "return" "try" "while" "yield"
|
||||||
;; Future keywords
|
;; Future keywords
|
||||||
"as" "None"
|
"as" "None" "with"
|
||||||
;; Not real keywords, but close enough to be fontified as such
|
;; Not real keywords, but close enough to be fontified as such
|
||||||
"self" "True" "False")
|
"self" "True" "False")
|
||||||
symbol-end)
|
symbol-end)
|
||||||
|
|
@ -374,7 +374,7 @@ BOS non-nil means point is known to be at beginning of statement."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(unless bos (python-beginning-of-statement))
|
(unless bos (python-beginning-of-statement))
|
||||||
(looking-at (rx (and (or "if" "else" "elif" "while" "for" "def"
|
(looking-at (rx (and (or "if" "else" "elif" "while" "for" "def"
|
||||||
"class" "try" "except" "finally")
|
"class" "try" "except" "finally" "with")
|
||||||
symbol-end)))))
|
symbol-end)))))
|
||||||
|
|
||||||
(defun python-close-block-statement-p (&optional bos)
|
(defun python-close-block-statement-p (&optional bos)
|
||||||
|
|
@ -2239,7 +2239,7 @@ with skeleton expansions for compound statement templates.
|
||||||
#'python-current-defun)
|
#'python-current-defun)
|
||||||
(set (make-local-variable 'outline-regexp)
|
(set (make-local-variable 'outline-regexp)
|
||||||
(rx (* space) (or "class" "def" "elif" "else" "except" "finally"
|
(rx (* space) (or "class" "def" "elif" "else" "except" "finally"
|
||||||
"for" "if" "try" "while")
|
"for" "if" "try" "while" "with")
|
||||||
symbol-end))
|
symbol-end))
|
||||||
(set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n")
|
(set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n")
|
||||||
(set (make-local-variable 'outline-level) #'python-outline-level)
|
(set (make-local-variable 'outline-level) #'python-outline-level)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue