mirror of
https://github.com/python/cpython.git
synced 2025-11-14 07:49:28 +00:00
(python-font-lock-keywords): added class and def
This commit is contained in:
parent
8e9d7d7e83
commit
44b7220b8b
1 changed files with 13 additions and 7 deletions
|
|
@ -38,6 +38,11 @@
|
||||||
;; (autoload 'python-mode "python-mode" "Python editing mode." t)
|
;; (autoload 'python-mode "python-mode" "Python editing mode." t)
|
||||||
;; (setq auto-mode-alist
|
;; (setq auto-mode-alist
|
||||||
;; (cons '("\\.py$" . python-mode) auto-mode-alist))
|
;; (cons '("\\.py$" . python-mode) auto-mode-alist))
|
||||||
|
;;
|
||||||
|
;; If you want font-lock support for Python source code (a.k.a. syntax
|
||||||
|
;; coloring, highlighting), add this to your .emacs file:
|
||||||
|
;;
|
||||||
|
;; (add-hook 'python-mode-hook 'turn-on-font-lock)
|
||||||
|
|
||||||
;; Here's a brief list of recent additions/improvements:
|
;; Here's a brief list of recent additions/improvements:
|
||||||
;;
|
;;
|
||||||
|
|
@ -189,13 +194,14 @@ displayed in the echo area, and if `py-beep-if-tab-change' is non-nil
|
||||||
the Emacs bell is also rung as a warning.")
|
the Emacs bell is also rung as a warning.")
|
||||||
|
|
||||||
(defconst python-font-lock-keywords
|
(defconst python-font-lock-keywords
|
||||||
(let* ((keywords '("access" "and" "break" "continue"
|
(let* ((keywords '("access" "and" "break" "class"
|
||||||
"del" "elif" "else:" "except"
|
"continue" "def" "del" "elif"
|
||||||
"except:" "exec" "finally:" "for"
|
"else:" "except" "except:" "exec"
|
||||||
"from" "global" "if" "import"
|
"finally:" "for" "from" "global"
|
||||||
"in" "is" "lambda" "not"
|
"if" "import" "in" "is"
|
||||||
"or" "pass" "print" "raise"
|
"lambda" "not" "or" "pass"
|
||||||
"return" "try:" "while"
|
"print" "raise" "return" "try:"
|
||||||
|
"while"
|
||||||
))
|
))
|
||||||
(kwregex (mapconcat 'identity keywords "\\|")))
|
(kwregex (mapconcat 'identity keywords "\\|")))
|
||||||
(list
|
(list
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue