Commit 4d82c9ae authored by Barry Warsaw's avatar Barry Warsaw

(python-font-lock-keywords): merged with XEmacs 19.12 font-lock.el

value
parent e64bfee4
...@@ -163,57 +163,65 @@ equal <number>, `tab-width' is set to <number>, a message saying so is ...@@ -163,57 +163,65 @@ equal <number>, `tab-width' is set to <number>, a message saying so is
displayed in the echo area, and if `py-beep-if-tab-change' is non-nil 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.")
(defvar python-font-lock-keywords ;; These were the previous font-lock keywords, but I think I now
(list ;; prefer the ones from XEmacs 19.12's font-lock.el. I've merged the
(cons ;; two into the new definition below.
(concat ;;
"\\<\\(" ;;(defvar python-font-lock-keywords
(mapconcat ;; (list
'identity ;; (cons
'("access" "and" "break" "continue" ;; (concat
"del" "elif" "else" "except" ;; "\\<\\("
"exec" "finally" "for" "from" ;; (mapconcat
"global" "if" "import" "in" ;; 'identity
"is" "lambda" "not" "or" ;; '("access" "and" "break" "continue"
"pass" "print" "raise" "return" ;; "del" "elif" "else" "except"
"try" "while" "def" "class" ;; "exec" "finally" "for" "from"
) ;; "global" "if" "import" "in"
"\\|") ;; "is" "lambda" "not" "or"
"\\)\\>") ;; "pass" "print" "raise" "return"
1) ;; "try" "while" "def" "class"
;; functions ;; )
'("\\bdef\\s +\\(\\sw+\\)(" 1 font-lock-function-name-face) ;; "\\|")
;; classes ;; "\\)\\>")
'("\\bclass\\s +\\(\\sw+\\)[(:]" 1 font-lock-function-name-face) ;; 1)
) ;; ;; functions
"*Additional keywords to highlight `python-mode' buffers.") ;; '("\\bdef\\s +\\(\\sw+\\)(" 1 font-lock-function-name-face)
;; ;; classes
;; These are taken from XEmacs 19.12's font-lock.el file. I prefer ;; '("\\bclass\\s +\\(\\sw+\\)[(:]" 1 font-lock-function-name-face)
;; these myself, but which do you think are better? ;; )
;; "*Additional keywords to highlight `python-mode' buffers.")
;; These are taken from XEmacs 19.12's font-lock.el file, but have the
;; more complete list of keywords from the previous definition in
;; python-mode.el. There are a few other minor stylistic changes as
;; well.
;; ;;
;;(defconst python-font-lock-keywords (defvar python-font-lock-keywords
;; (purecopy (list
;; (list (cons (concat
;; (cons (concat "\\b\\(" "\\b\\("
;; (mapconcat 'identity (mapconcat
;; '("access" "del" "from" 'identity
;; "lambda" "return" "and" '("access" "and" "break" "continue"
;; "elif" "global" "not" "del" "elif" "else:" "except"
;; "try:" "break " "else:" "except:" "exec" "finally:" "for"
;; "if" "or" "while" "from" "global" "if" "import"
;; "except" "except:" "import" "in" "is" "lambda" "not"
;; "pass" "continue" "finally:" "or" "pass" "print" "raise"
;; "in" "print" "for" "return" "try:" "while"
;; "is" "raise") )
;; "\\|") "\\|")
;; "\\)[ \n\t(]") "\\)[ \n\t(]")
;; 1) 1)
;; '("\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)" ;; classes
;; 1 font-lock-type-face) '("\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
;; '("\\bdef[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)" 1 font-lock-type-face)
;; 1 font-lock-function-name-face) ;; functions
;; )) '("\\bdef[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
;; "Additional expressions to highlight in Python mode.") 1 font-lock-function-name-face)
)
"*Additional expressions to highlight in Python mode.")
;; R Lindsay Todd <toddr@rpi.edu> suggests these changes to the ;; R Lindsay Todd <toddr@rpi.edu> suggests these changes to the
;; original keywords, which wouldn't be necessary if we go with the ;; original keywords, which wouldn't be necessary if we go with the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment