Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4d82c9ae
Commit
4d82c9ae
authored
Jul 05, 1995
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(python-font-lock-keywords): merged with XEmacs 19.12 font-lock.el
value
parent
e64bfee4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
50 deletions
+58
-50
Misc/python-mode.el
Misc/python-mode.el
+58
-50
No files found.
Misc/python-mode.el
View file @
4d82c9ae
...
...
@@ -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
the Emacs bell is also rung as a warning."
)
;; These were the previous font-lock keywords, but I think I now
;; prefer the ones from XEmacs 19.12's font-lock.el. I've merged the
;; two into the new definition below.
;;
;;(defvar python-font-lock-keywords
;; (list
;; (cons
;; (concat
;; "\\<\\("
;; (mapconcat
;; 'identity
;; '("access" "and" "break" "continue"
;; "del" "elif" "else" "except"
;; "exec" "finally" "for" "from"
;; "global" "if" "import" "in"
;; "is" "lambda" "not" "or"
;; "pass" "print" "raise" "return"
;; "try" "while" "def" "class"
;; )
;; "\\|")
;; "\\)\\>")
;; 1)
;; ;; functions
;; '("\\bdef\\s +\\(\\sw+\\)(" 1 font-lock-function-name-face)
;; ;; classes
;; '("\\bclass\\s +\\(\\sw+\\)[(:]" 1 font-lock-function-name-face)
;; )
;; "*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.
;;
(
defvar
python-font-lock-keywords
(
list
(
cons
(
concat
"\\<\\("
(
cons
(
concat
"\\b\\("
(
mapconcat
'identity
'
(
"access"
"and"
"break"
"continue"
"del"
"elif"
"else"
"except"
"exec"
"finally"
"for"
"from
"
"global"
"if"
"import"
"in
"
"is"
"lambda"
"not"
"or
"
"pass"
"print"
"raise"
"return
"
"try"
"while"
"def"
"class
"
"del"
"elif"
"else:"
"except"
"except:"
"exec"
"finally:"
"for
"
"from"
"global"
"if"
"import
"
"in"
"is"
"lambda"
"not
"
"or"
"pass"
"print"
"raise
"
"return"
"try:"
"while
"
)
"\\|"
)
"\\)\\>
"
)
"\\)[ \n\t(]
"
)
1
)
;; functions
'
(
"\\bdef\\s +\\(\\sw+\\)("
1
font-lock-function-name-face
)
;; classes
'
(
"\\bclass\\s +\\(\\sw+\\)[(:]"
1
font-lock-function-name-face
)
'
(
"\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
1
font-lock-type-face
)
;; functions
'
(
"\\bdef[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
1
font-lock-function-name-face
)
)
"*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.")
"*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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment