summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1995-06-20 18:55:34 (GMT)
committerBarry Warsaw <barry@python.org>1995-06-20 18:55:34 (GMT)
commitb01b4fa130f29de39a8bbf4b4f1b2a050f816235 (patch)
tree2dcca702ebdce76547cff763a24d9468aa1c7cc6
parent98590187d5d2b89a95a7aa82edc00feb13a24ae4 (diff)
downloadcpython-b01b4fa130f29de39a8bbf4b4f1b2a050f816235.zip
cpython-b01b4fa130f29de39a8bbf4b4f1b2a050f816235.tar.gz
cpython-b01b4fa130f29de39a8bbf4b4f1b2a050f816235.tar.bz2
Added tbd's on python-font-lock-keywords
-rw-r--r--Misc/python-mode.el37
1 files changed, 37 insertions, 0 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index bd2d0d9..3c338d3 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -188,6 +188,43 @@ the Emacs bell is also rung as a warning.")
)
"*Additional keywords to highlight `python-mode' buffers.")
+;; These are taken from XEmacs 19.12's font-lock.el file. I prefer
+;; these myself, but which do you think are better?
+;;
+;;(defconst python-font-lock-keywords
+;; (purecopy
+;; (list
+;; (cons (concat "\\b\\("
+;; (mapconcat 'identity
+;; '("access" "del" "from"
+;; "lambda" "return" "and"
+;; "elif" "global" "not"
+;; "try:" "break " "else:"
+;; "if" "or" "while"
+;; "except" "except:" "import"
+;; "pass" "continue" "finally:"
+;; "in" "print" "for"
+;; "is" "raise")
+;; "\\|")
+;; "\\)[ \n\t(]")
+;; 1)
+;; '("\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
+;; 1 font-lock-type-face)
+;; '("\\bdef[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
+;; 1 font-lock-function-name-face)
+;; ))
+;; "Additional expressions to highlight in Python mode.")
+
+;; R Lindsay Todd <toddr@rpi.edu> suggests these changes to the
+;; original keywords, which wouldn't be necessary if we go with the
+;; XEmacs defaults, but which I agree makes sense without them.
+;;
+;; functions
+;; '("\\bdef\\s +\\(\\sw+\\)\\s *(" 1 font-lock-function-name-face)
+;; classes
+;; '("\\bclass\\s +\\(\\sw+\\)\\s *[(:]" 1 font-lock-type-face)
+
+
;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;; NO USER DEFINABLE VARIABLES BEYOND THIS POINT