Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
e0e277ff
Commit
e0e277ff
authored
Sep 09, 1997
by
Simon Marshall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to comment where font-lock-keyword order is important.
parent
a9984412
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
42 deletions
+46
-42
lisp/font-lock.el
lisp/font-lock.el
+46
-42
No files found.
lisp/font-lock.el
View file @
e0e277ff
...
@@ -597,39 +597,6 @@ This is normally set via `font-lock-defaults'.")
...
@@ -597,39 +597,6 @@ This is normally set via `font-lock-defaults'.")
(
defvar
font-lock-mode-hook
nil
(
defvar
font-lock-mode-hook
nil
"Function or functions to run on entry to Font Lock mode."
)
"Function or functions to run on entry to Font Lock mode."
)
;; Originally these variable values were face names such as `bold' etc.
;; Now we create our own faces, but we keep these variables for compatibility
;; and they give users another mechanism for changing face appearance.
;; We now allow a FACENAME in `font-lock-keywords' to be any expression that
;; returns a face. So the easiest thing is to continue using these variables,
;; rather than sometimes evaling FACENAME and sometimes not. sm.
(
defvar
font-lock-comment-face
'font-lock-comment-face
"Face name to use for comments."
)
(
defvar
font-lock-string-face
'font-lock-string-face
"Face name to use for strings."
)
(
defvar
font-lock-keyword-face
'font-lock-keyword-face
"Face name to use for keywords."
)
(
defvar
font-lock-builtin-face
'font-lock-builtin-face
"Face name to use for builtins."
)
(
defvar
font-lock-function-name-face
'font-lock-function-name-face
"Face name to use for function names."
)
(
defvar
font-lock-variable-name-face
'font-lock-variable-name-face
"Face name to use for variable names."
)
(
defvar
font-lock-type-face
'font-lock-type-face
"Face name to use for type names."
)
(
defvar
font-lock-reference-face
'font-lock-reference-face
"Face name to use for reference names."
)
(
defvar
font-lock-warning-face
'font-lock-warning-face
"Face name to use for things that should stand out."
)
;; Font Lock mode.
;; Font Lock mode.
(
eval-when-compile
(
eval-when-compile
...
@@ -649,7 +616,13 @@ This is normally set via `font-lock-defaults'.")
...
@@ -649,7 +616,13 @@ This is normally set via `font-lock-defaults'.")
(
,@
body
)
(
,@
body
)
(
when
(
and
(
not
modified
)
(
buffer-modified-p
))
(
when
(
and
(
not
modified
)
(
buffer-modified-p
))
(
set-buffer-modified-p
nil
)))))
(
set-buffer-modified-p
nil
)))))
(
put
'save-buffer-state
'lisp-indent-function
1
))
(
put
'save-buffer-state
'lisp-indent-function
1
)
;;
;; Shut up the byte compiler.
(
defvar
global-font-lock-mode
)
; Now a defcustom.
(
defvar
font-lock-face-attributes
)
; Obsolete but respected if set.
(
defvar
font-lock-string-face
)
; Used in syntactic fontification.
(
defvar
font-lock-comment-face
))
;;;###autoload
;;;###autoload
(
defun
font-lock-mode
(
&optional
arg
)
(
defun
font-lock-mode
(
&optional
arg
)
...
@@ -836,8 +809,6 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
...
@@ -836,8 +809,6 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
(
defvar
font-lock-buffers
nil
)
; For remembering buffers.
(
defvar
font-lock-buffers
nil
)
; For remembering buffers.
(
defvar
global-font-lock-mode
)
;Prevent warnings in defun below.
;;;###autoload
;;;###autoload
(
defun
global-font-lock-mode
(
&optional
arg
message
)
(
defun
global-font-lock-mode
(
&optional
arg
message
)
"Toggle Global Font Lock mode.
"Toggle Global Font Lock mode.
...
@@ -863,7 +834,7 @@ turned on in a buffer if its major mode is one of `font-lock-global-modes'."
...
@@ -863,7 +834,7 @@ turned on in a buffer if its major mode is one of `font-lock-global-modes'."
(
font-lock-mode
)))))
(
font-lock-mode
)))))
(
buffer-list
))))
(
buffer-list
))))
(
when
message
(
when
message
(
message
"Global Font Lock mode %s"
(
if
on-p
"enabled"
"disabled"
)))
(
message
"Global Font Lock mode %s
.
"
(
if
on-p
"enabled"
"disabled"
)))
(
setq
global-font-lock-mode
on-p
)))
(
setq
global-font-lock-mode
on-p
)))
;; Naughty hack. This variable was originally a `defvar' to keep track of
;; Naughty hack. This variable was originally a `defvar' to keep track of
...
@@ -1616,7 +1587,38 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
...
@@ -1616,7 +1587,38 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
;;; Colour etc. support.
;;; Colour etc. support.
(
defvar
font-lock-face-attributes
)
;Avoid compiler warnings below.
;; Originally these variable values were face names such as `bold' etc.
;; Now we create our own faces, but we keep these variables for compatibility
;; and they give users another mechanism for changing face appearance.
;; We now allow a FACENAME in `font-lock-keywords' to be any expression that
;; returns a face. So the easiest thing is to continue using these variables,
;; rather than sometimes evaling FACENAME and sometimes not. sm.
(
defvar
font-lock-comment-face
'font-lock-comment-face
"Face name to use for comments."
)
(
defvar
font-lock-string-face
'font-lock-string-face
"Face name to use for strings."
)
(
defvar
font-lock-keyword-face
'font-lock-keyword-face
"Face name to use for keywords."
)
(
defvar
font-lock-builtin-face
'font-lock-builtin-face
"Face name to use for builtins."
)
(
defvar
font-lock-function-name-face
'font-lock-function-name-face
"Face name to use for function names."
)
(
defvar
font-lock-variable-name-face
'font-lock-variable-name-face
"Face name to use for variable names."
)
(
defvar
font-lock-type-face
'font-lock-type-face
"Face name to use for type names."
)
(
defvar
font-lock-reference-face
'font-lock-reference-face
"Face name to use for reference names."
)
(
defvar
font-lock-warning-face
'font-lock-warning-face
"Face name to use for things that should stand out."
)
;; Originally face attributes were specified via `font-lock-face-attributes'.
;; Originally face attributes were specified via `font-lock-face-attributes'.
;; Users then changed the default face attributes by setting that variable.
;; Users then changed the default face attributes by setting that variable.
...
@@ -1919,7 +1921,6 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
...
@@ -1919,7 +1921,6 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
"("
(
regexp-opt
"("
(
regexp-opt
'
(
"cond"
"if"
"while"
"catch"
"throw"
"let"
"let*"
'
(
"cond"
"if"
"while"
"catch"
"throw"
"let"
"let*"
"prog"
"progn"
"progv"
"prog1"
"prog2"
"prog*"
"prog"
"progn"
"progv"
"prog1"
"prog2"
"prog*"
"closure"
"preparse-closure"
"make-closure"
"inline"
"save-restriction"
"save-excursion"
"inline"
"save-restriction"
"save-excursion"
"save-window-excursion"
"save-selected-window"
"save-window-excursion"
"save-selected-window"
"save-match-data"
"save-current-buffer"
"unwind-protect"
"save-match-data"
"save-current-buffer"
"unwind-protect"
...
@@ -2332,6 +2333,7 @@ See also `c-font-lock-extra-types'.")
...
@@ -2332,6 +2333,7 @@ See also `c-font-lock-extra-types'.")
(
1
font-lock-keyword-face
)
(
2
font-lock-reference-face
nil
t
))
(
1
font-lock-keyword-face
)
(
2
font-lock-reference-face
nil
t
))
;; Anders Lindgren <andersl@csd.uu.se> points out that it is quicker to use
;; Anders Lindgren <andersl@csd.uu.se> points out that it is quicker to use
;; MATCH-ANCHORED to effectively anchor the regexp on the left.
;; MATCH-ANCHORED to effectively anchor the regexp on the left.
;; This must come after the one for keywords and targets.
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:"
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:"
(
beginning-of-line
)
(
end-of-line
)
(
beginning-of-line
)
(
end-of-line
)
(
1
font-lock-reference-face
)))
(
1
font-lock-reference-face
)))
...
@@ -2432,8 +2434,7 @@ See also `c++-font-lock-extra-types'.")
...
@@ -2432,8 +2434,7 @@ See also `c++-font-lock-extra-types'.")
(
eval-when-compile
(
eval-when-compile
(
regexp-opt
(
regexp-opt
'
(
"break"
"continue"
"do"
"else"
"for"
"if"
"return"
"switch"
'
(
"break"
"continue"
"do"
"else"
"for"
"if"
"return"
"switch"
"while"
"asm"
"catch"
"delete"
"new"
"operator"
"sizeof"
"this"
"while"
"asm"
"catch"
"delete"
"new"
"sizeof"
"this"
"throw"
"try"
"throw"
"try"
;; Eric Hopper <hopper@omnifarious.mn.org> says these are new.
;; Eric Hopper <hopper@omnifarious.mn.org> says these are new.
"static_cast"
"dynamic_cast"
"const_cast"
"reinterpret_cast"
)
t
)))
"static_cast"
"dynamic_cast"
"const_cast"
"reinterpret_cast"
)
t
)))
(
c++-operators
(
c++-operators
...
@@ -2513,6 +2514,7 @@ See also `c++-font-lock-extra-types'.")
...
@@ -2513,6 +2514,7 @@ See also `c++-font-lock-extra-types'.")
;; Fontify case/goto keywords and targets, and case default/goto tags.
;; Fontify case/goto keywords and targets, and case default/goto tags.
'
(
"\\<\\(case\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?"
'
(
"\\<\\(case\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?"
(
1
font-lock-keyword-face
)
(
2
font-lock-reference-face
nil
t
))
(
1
font-lock-keyword-face
)
(
2
font-lock-reference-face
nil
t
))
;; This must come after the one for keywords and targets.
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:\\($\\|[^:]\\)"
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:\\($\\|[^:]\\)"
(
beginning-of-line
)
(
end-of-line
)
(
beginning-of-line
)
(
end-of-line
)
(
1
font-lock-reference-face
)))
(
1
font-lock-reference-face
)))
...
@@ -2662,12 +2664,13 @@ See also `objc-font-lock-extra-types'.")
...
@@ -2662,12 +2664,13 @@ See also `objc-font-lock-extra-types'.")
'
(
"\\<\\(case\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?"
'
(
"\\<\\(case\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?"
(
1
font-lock-keyword-face
)
(
2
font-lock-reference-face
nil
t
))
(
1
font-lock-keyword-face
)
(
2
font-lock-reference-face
nil
t
))
;; Fontify tags iff sole statement on line, otherwise we detect selectors.
;; Fontify tags iff sole statement on line, otherwise we detect selectors.
;; This must come after the one for keywords and targets.
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$"
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$"
(
beginning-of-line
)
(
end-of-line
)
(
beginning-of-line
)
(
end-of-line
)
(
1
font-lock-reference-face
)))
(
1
font-lock-reference-face
)))
;;
;;
;; Fontify null object pointers.
;; Fontify null object pointers.
'
(
"\\<
\\(Nil\\|n
il\\
)\\
>"
1
font-lock-reference-face
)
'
(
"\\<
[Nn]
il\\>"
.
font-lock-reference-face
)
)))
)))
(
setq
objc-font-lock-keywords-3
(
setq
objc-font-lock-keywords-3
...
@@ -2788,6 +2791,7 @@ See also `java-font-lock-extra-types'.")
...
@@ -2788,6 +2791,7 @@ See also `java-font-lock-extra-types'.")
;; Fontify keywords and targets, and case default/goto tags.
;; Fontify keywords and targets, and case default/goto tags.
(
list
"\\<\\(break\\|case\\|continue\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?"
(
list
"\\<\\(break\\|case\\|continue\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?"
'
(
1
font-lock-keyword-face
)
'
(
2
font-lock-reference-face
nil
t
))
'
(
1
font-lock-keyword-face
)
'
(
2
font-lock-reference-face
nil
t
))
;; This must come after the one for keywords and targets.
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:"
'
(
":"
(
"^[ \t]*\\(\\sw+\\)[ \t]*:"
(
beginning-of-line
)
(
end-of-line
)
(
beginning-of-line
)
(
end-of-line
)
(
1
font-lock-reference-face
)))
(
1
font-lock-reference-face
)))
...
...
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