Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
60bdd17f
Commit
60bdd17f
authored
Oct 06, 1998
by
Eli Zaretskii
Browse files
(bat-generic-mode): Fix regexps for keywords and
built-in commands. Add more built-in commands and fix face names.
parent
1d7d10d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
20 deletions
+51
-20
lisp/generic-x.el
lisp/generic-x.el
+51
-20
No files found.
lisp/generic-x.el
View file @
60bdd17f
...
...
@@ -274,7 +274,7 @@ you must reload generic-x to enable the specified modes."
'
((
nil
"^\\s-*\\(.*\\)\\s-*="
1
))))))
"Generic mode for MS-Windows Registry files."
))
;;; Windows BAT files
;;;
DOS/
Windows BAT files
(
if
(
not
(
memq
'bat-generic-mode
generic-extras-enable-list
))
nil
(
define-generic-mode
'bat-generic-mode
...
...
@@ -285,39 +285,70 @@ you must reload generic-x to enable the specified modes."
;; be over-written by other variables
(
list
"^[@ \t]*\\([rR][eE][mM][^\n\r]*\\)"
1
'font-lock-comment-face
t
)
(
list
"^[ \t]*\\(::-.*\\)"
1
'font-lock-comment-face
t
)
;; These keywords appear as the first word on a line
(
list
"^[@ \t]*\\([bB][rR][eE][aA][kK]\\|[vV][eE][rR][iI][fF][yY]\\)[ \t]+\\([oO]\\([nN]\\|[fF][fF]\\)\\)"
'
(
1
font-lock-builtin-face
)
'
(
2
font-lock-constant-face
'append
t
))
;; Any text (except ON/OFF) following ECHO is a string.
(
list
"^[@ \t]*\\([eE][cC][hH][oO]\\)[ \t]+\\(\\([oO]\\([nN]\\|[fF][fF]\\)\\)\\|\\([^>|\r\n]+\\)\\)"
'
(
1
font-lock-builtin-face
)
'
(
3
font-lock-constant-face
t
t
)
'
(
5
font-lock-string-face
t
t
))
;; These keywords appear as the first word on a line. (Actually, they
;; can also appear after "if ..." or "for ..." clause, but since they
;; are frequently used in simple text, we punt.)
(
generic-make-keywords-list
(
list
"[cC][aA][lL][lL]"
"[eE][cC][hH][oO]"
"[fF][oO][rR]"
"[iI][fF]"
"[pP][aA][tT][hH]"
"[pP][aA][uU][sS][eE]"
"[pP][rR][oO][mM][pP][tT]"
"[sS][eE][tT]"
"[sS][tT][aA][rR][tT]"
"FOR"
"for"
"For"
"IF"
"if"
"If"
)
'font-lock-keyword-face
"^[@ \t]*"
)
;; These keywords can be anywhere on a line
(
generic-make-keywords-list
(
list
"[eE][xX][iI][sS][tT]"
"[eE][rR][rR][oO][rR][lL][eE][vV][eE][lL]"
"[gG][oO][tT][oO]"
"[nN][oO][tT]"
)
'font-lock-keyword-face
)
"DO"
"do"
"Do"
"EXIST"
"exist"
"Exist"
"ERRORLEVEL"
"errorlevel"
"ErrorLevel"
"Errorlevel"
"GOTO"
"goto"
"GoTo"
"Goto"
"NOT"
"not"
"Not"
)
'font-lock-keyword-face
"[ \t|\n]"
)
; These are built-in commands. Only frequently-used ones are listed.
(
generic-make-keywords-list
(
list
"CALL"
"call"
"Call"
"CD"
"cd"
"Cd"
"CLS"
"cls"
"Cls"
"COPY"
"copy"
"Copy"
"DEL"
"del"
"Del"
"ECHO"
"echo"
"Echo"
"MD"
"md"
"Md"
"PATH"
"path"
"Path"
"PAUSE"
"pause"
"Pause"
"PROMPT"
"prompt"
"Prompt"
"RD"
"rd"
"Rd"
"REN"
"ren"
"Ren"
"SET"
"set"
"Set"
"START"
"start"
"Start"
"SHIFT"
"shift"
"Shift"
)
'font-lock-builtin-face
"[ \t|\n]"
)
(
list
"^[ \t]*\\(:\\sw+\\)"
1
'font-lock-function-name-face
t
)
(
list
"\\(%\\sw+%\\)"
1
'font-lock-
referenc
e-face
)
(
list
"\\(%[0-9]\\)"
1
'font-lock-
referenc
e-face
)
(
list
"\\(%\\sw+%\\)"
1
'font-lock-
variable-nam
e-face
t
)
(
list
"\\(%[0-9]\\)"
1
'font-lock-
variable-nam
e-face
t
)
(
list
"\\(/[^/ \"\t\n]+\\)"
1
'font-lock-type-face
)
(
list
"[\t ]+\\([+-][^\t\n\" ]+\\)"
1
'font-lock-type-face
)
(
list
"\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(\\sw+\\)?"
(
list
"
[ \t\n|]
\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(\\sw+\\)?"
'
(
1
font-lock-keyword-face
)
'
(
2
font-lock-function-name-face
nil
t
))
(
list
"[ \t\n|]\\<\\([sS][eE][tT]\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*=?"
'
(
1
font-lock-builtin-face
)
'
(
2
font-lock-variable-name-face
t
t
))
)
(
list
"\\.[bB][aA][tT]\\'"
"CONFIG\\."
"AUTOEXEC\\."
)
(
list
"\\.[bB][aA][tT]\\'"
"\\`[cC][oO][nN][fF][iI][gG]\\."
"\\`[aA][uU][tT][oO][eE][xX][eE][cC]\\."
)
(
list
'generic-bat-mode-setup-function
)
"Generic mode for MS-Windows BAT files."
)
...
...
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