Commit ef1c5063 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(generic-x): Added defgroup declaration.

(generic-bat-mode-setup-function): Fixed comment-start variable.

(generic-define-mswindows-modes): Enable
hosts-generic-mode and apache-generic-mode.
(generic-define-unix-modes): Enable alias-generic-mode.
(java-properties-generic-mode): Changed regexp to allow property
and value to be separated by whitespace or an equal sign.
(alias-generic-mode): Check generic-extras-enable-list before
defining this mode.

(installshield-statement-keyword-list): New variable.
(installshield-system-functions-list): Likewise.
(installshield-system-variables-list): Likewise.
(installshield-types-list): Likewise.
(installshield-funarg-constants-list): Likewise.
(rul-generic-mode): Uses the variables listed above instead of
hard-coding the lists of keywords.
parent 5bbc1cf7
......@@ -91,6 +91,11 @@
(require 'generic)
(require 'font-lock)
(defgroup generic-x nil
"Extra modes for generic mode."
:prefix "generic-"
:group 'generic)
(defcustom generic-extras-enable-list nil
"*List of generic modes to enable by default.
Each entry in the list should be a symbol.
......@@ -120,7 +125,8 @@ you must reload generic-x to enable the specified modes."
(setq generic-extras-enable-list
(append (list 'bat-generic-mode 'ini-generic-mode
'inf-generic-mode 'rc-generic-mode
'reg-generic-mode 'rul-generic-mode)
'reg-generic-mode 'rul-generic-mode
'hosts-generic-mode 'apache-generic-mode)
generic-extras-enable-list)))
(and generic-define-unix-modes
......@@ -128,6 +134,7 @@ you must reload generic-x to enable the specified modes."
(append (list 'apache-generic-mode 'samba-generic-mode
'hosts-generic-mode 'fvwm-generic-mode
'x-resource-generic-mode
'alias-generic-mode
)
generic-extras-enable-list)))
......@@ -333,7 +340,7 @@ you must reload generic-x to enable the specified modes."
(setq imenu-generic-expression '((nil "^:\\(\\sw+\\)" 1))
parse-sexp-ignore-comments t
comment-end ""
comment-start "[Rr][Ee][Mm] "
comment-start "REM "
comment-start-skip "[Rr][Ee][Mm] *"
)
(set-syntax-table bat-generic-mode-syntax-table)
......@@ -514,13 +521,16 @@ you must reload generic-x to enable the specified modes."
(list ?#)
nil
;; Property and value can be separated with whitespace or an equal sign
'(("^\\([A-Za-z0-9_]+\\)\\(\\s-+\\|\\s-*=\\s-*\\)\\([^\r\n]*\\)\\'"
(1 font-lock-reference-face) (3 font-lock-variable-name-face)))
'(("^\\([\\.A-Za-z0-9_]+\\)\\(\\s-+\\|\\(\\s-*=\\s-*\\)\\)\\([^\r\n]*\\)$"
(1 font-lock-reference-face) (4 font-lock-variable-name-face)))
nil
nil
"Mode for Java properties files.")
;; C shell alias definitions
(and
(memq 'alias-generic-mode generic-extras-enable-list)
(define-generic-mode 'alias-generic-mode
(list ?#)
(list "alias" "unalias")
......@@ -537,6 +547,7 @@ you must reload generic-x to enable the specified modes."
'((nil "^\\(alias\\|unalias\\)\\s-+\\([-a-zA-Z0-9_]+\\)" 2)))
)))
"Mode for C Shell alias files.")
)
;;; Windows RC files
;; Contributed by ACorreir@pervasive-sw.com (Alfred Correira)
......@@ -631,46 +642,543 @@ you must reload generic-x to enable the specified modes."
nil
"Generic mode for MS-Windows Resource files."))
;;; InstallShield RUL files
;; InstallShield RUL files
;; Contributed by Alfred.Correira@Pervasive.Com
(and
(memq 'rul-generic-mode generic-extras-enable-list)
;;; build the regexp strings using regexp-opt
(defvar installshield-statement-keyword-list
(list
"abort"
"begin"
"call"
"case"
"declare"
"default"
"downto"
"elseif"
"else"
"endfor"
"endif"
"endswitch"
"endwhile"
"end"
"exit"
"external"
"for"
"function"
;; "goto" -- handled elsewhere
"if"
"program"
"prototype"
"repeat"
"return"
"step"
"switch"
"then"
"to"
"typedef"
"until"
"void"
"while"
)
"Statement keywords used in InstallShield 3 and 5.")
(defvar installshield-system-functions-list
(list
"AddFolderIcon"
"AddProfString"
"AddressString"
"AppCommand"
"AskDestPath"
"AskOptions"
"AskPath"
"AskText"
"AskYesNo"
"BatchDeleteEx"
"BatchFileLoad"
"BatchFileSave"
"BatchFind"
"BatchGetFileName"
"BatchMoveEx"
"BatchSetFileName"
"CloseFile"
"CmdGetHwndDlg"
"ComponentAddItem" ; differs between IS3 and IS5
"ComponentCompareSizeRequired" ; IS5 only
"ComponentDialog"
"ComponentError" ; IS5 only
"ComponentFileEnum" ; IS5 only
"ComponentFileInfo" ; IS5 only
"ComponentFilterLanguage" ; IS5 only
"ComponentFilterOS" ; IS5 only
"ComponentGetData" ; IS5 only
"ComponentGetItemInfo" ; IS3 only
"ComponentGetItemSize" ; differs between IS3 and IS5
"ComponentIsItemSelected" ; differs between IS3 and IS5
"ComponentListItems"
"ComponentMoveData" ; IS5 only
"ComponentSelectItem" ; differs between IS3 and IS5
"ComponentSetData" ; IS5 only
"ComponentSetItemInfo" ; IS3 only
"ComponentSetTarget" ; IS5 only
"ComponentSetupTypeEnum" ; IS5 only
"ComponentSetupTypeGetData" ; IS5 only
"ComponentSetupTypeSet" ; IS5 only
"ComponentTotalSize"
"ComponentValidate" ; IS5 only
"CompressAdd" ; IS3 only
"CompressDel" ; IS3 only
"CompressEnum" ; IS3 only
"CompressGet" ; IS3 only
"CompressInfo" ; IS3 only
"CopyFile"
"CreateDir"
"CreateFile"
"CreateProgramFolder"
"DeinstallSetReference" ; IS5 only
"DeinstallStart"
"Delay"
"DeleteDir"
"DeleteFile"
"DialogSetInfo"
"Disable"
"DoInstall"
"Do"
"Enable"
"EnterDisk"
"ExistsDir"
"ExistsDisk"
"ExitProgMan"
"EzBatchAddPath"
"EzBatchAddString"
"EzBatchReplace"
"EzConfigAddDriver"
"EzConfigAddString"
"EzConfigGetValue"
"EzConfigSetValue"
"EzDefineDialog"
"FileCompare"
"FileDeleteLine"
"FileGrep"
"FileInsertLine"
"FileSetBeginDefine" ; IS3 only
"FileSetEndDefine" ; IS3 only
"FileSetPerformEz" ; IS3 only
"FileSetPerform" ; IS3 only
"FileSetReset" ; IS3 only
"FileSetRoot" ; IS3 only
"FindAllDirs"
"FindAllFiles"
"FindFile"
"FindWindow"
"GetDiskSpace"
"GetDisk"
"GetEnvVar"
"GetExtents"
"GetFileInfo"
"GetLine"
"GetProfString"
"GetSystemInfo"
"GetValidDrivesList"
"GetVersion"
"GetWindowHandle"
"InstallationInfo"
"Is"
"LaunchApp"
"ListAddItem"
"ListAddString"
"ListCount"
"ListCreate"
"ListDestroy"
"ListFindItem"
"ListFindString"
"ListGetFirstItem"
"ListGetFirstString"
"ListGetNextItem"
"ListGetNextString"
"ListReadFromFile"
"ListSetNextItem"
"ListSetNextString"
"ListSetIndex"
"ListWriteToFile"
"LongPathToQuote"
"LongPathToShortPath"
"MessageBox"
"NumToStr"
"OpenFileMode"
"OpenFile"
"ParsePath"
"PathAdd"
"PathDelete"
"PathFind"
"PathGet"
"PathMove"
"PathSet"
"Path"
"PlaceBitmap"
"PlaceWindow"
"PlayMMedia" ; IS5 only
"ProgDefGroupType"
"RegDBCreateKeyEx"
"RegDbDeleteValue"
"RegDBGetItem"
"RegDBKeyExist"
"RegDBSetItem"
"RegDBGetKeyValueEx"
"RegDBSetKeyValueEx"
"RegDBSetDefaultRoot"
"RenameFile"
"ReplaceFolderIcon"
"ReplaceProfString"
"SdAskDestPath"
"SdAskOptions"
"SdAskOptionsList"
"SdBitmap"
"SdCloseDlg"
"SdComponentAdvCheckSpace"
"SdComponentAdvInit"
"SdComponentAdvUpdateSpace"
"SdComponentDialog"
"SdComponentDialog2"
"SdComponentDialogAdv"
"SdComponentDialogEx"
"SdComponentDlgCheckSpace"
"SdComponentMult"
"SdConfirmNewDir"
"SdConfirmRegistration"
"SdDiskSpace"
"SdDisplayTopics"
"SdDoStdButton"
"SdEnablement"
"SdError"
"SdFinish"
"SdFinishInit32"
"SdFinishReboot"
"SdGeneralInit"
"SdGetItemName"
"SdGetTextExtent"
"SdGetUserCompanyInfo"
"SdInit"
"SdIsShellExplorer"
"SdIsStdButton"
"SdLicense"
"SdMakeName"
"SdOptionInit"
"SdOptionSetState"
"SdOptionsButtons"
"SdOptionsButtonsInit"
"SdPlugInProductName"
"SdProductName"
"SdRegEnableButton"
"SdRegExEnableButton"
"SdRegisterUser"
"SdRegisterUserEx"
"SdRemoveEndSpace"
"SdSelectFolder"
"SdSetSequentialItems"
"SdSetStatic"
"SdSetupTypeEx" ; IS5 only
"SdSetupType"
"SdShowAnyDialog"
"SdShowDlgEdit1"
"SdShowDlgEdit2"
"SdShowDlgEdit3"
"SdShowFileMods"
"SdShowInfoList"
"SdShowMsg"
"SdStartCopy"
"SdUnInit"
"SdUpdateComponentSelection"
"SdWelcome"
"SendMessage"
"SetColor"
"SetFont"
"SetDialogTitle"
"SetDisplayEffect" ; IS5 only
"SetFileInfo"
"SetForegroundWindow"
"SetStatusWindow"
"SetTitle"
"SetupType"
"ShowProgramFolder"
"Split" ; IS3 only
"SprintfBox"
"Sprintf"
"StatusUpdate"
"StrCompare"
"StrFind"
"StrGetTokens"
"StrLength"
"StrRemoveLastSlash"
"StrToLower"
"StrToUpper"
"StrSub"
"VarRestore"
"VarSave"
"VerCompare"
"VerGetFileVersion"
"WaitOnDialog"
"Welcome"
"WriteLine"
"WriteProfString"
"XCopyFile"
)
"System functions defined in InstallShield 3 and 5.")
(defvar installshield-system-variables-list
(list
"CMDLINE"
"CORECOMPONENTHANDLING"
"ERRORFILENAME"
"INFOFILENAME"
"ISRES"
"ISUSER"
"ISVERSION"
"MODE"
"SRCDIR"
"SRCDISK"
"SUPPORTDIR"
"TARGETDIR"
"TARGETDISK"
"WINDIR"
"WINDISK"
"WINMAJOR"
"WINSYSDIR"
"WINSYSDISK"
)
"System variables used in InstallShield 3 and 5.")
(defvar installshield-types-list
(list
"BOOL"
"BYREF"
"CHAR"
"HIWORD"
"HWND"
"INT"
"LIST"
"LONG"
"LOWORD"
"NUMBER"
"POINTER"
"QUAD"
"RGB"
"SHORT"
"STRINGLIST"
"STRING"
)
"Type keywords used in InstallShield 3 and 5.")
;;; some might want to skip highlighting these to improve performance
(defvar installshield-funarg-constants-list
(list
"AFTER"
"APPEND"
"ALLCONTENTS"
"BACKBUTTON"
"BACKGROUNDCAPTION"
"BACKGROUND"
"BACK"
"BASEMEMORY"
"BEFORE"
"BIOS"
"BITMAPICON"
"BK_BLUE"
"BK_GREEN"
"BK_RED"
"BLUE"
"BOOTUPDRIVE"
"CANCEL"
"CDROM_DRIVE"
"CDROM"
"CHECKBOX95"
"CHECKBOX"
"CHECKLINE"
"CHECKMARK"
"COLORS"
"COMMANDEX"
"COMMAND"
"COMP_NORMAL"
"COMP_UPDATE_DATE"
"COMP_UPDATE_SAME"
"COMP_UPDATE_VERSION"
"COMPACT"
"CONTINUE"
"CPU"
"CUSTOM"
"DATE"
"DEFWINDOWMODE"
"DIR_WRITEABLE"
"DIRECTORY"
"DISABLE"
"DISK_TOTALSPACE"
"DISK"
"DLG_OPTIONS"
"DLG_PATH"
"DLG_TEXT"
"DLG_ASK_YESNO"
"DLG_ENTER_DISK"
"DLG_ERR"
"DLG_INFO_ALTIMAGE"
"DLG_INFO_CHECKSELECTION"
"DLG_INFO_KUNITS"
"DLG_INFO_USEDECIMAL"
"DLG_MSG_INFORMATION"
"DLG_MSG_SEVERE"
"DLG_MSG_WARNING"
"DLG_STATUS"
"DLG_WARNING"
"DLG_USER_CAPTION"
"DRIVE"
"ENABLE"
"END_OF_FILE"
"END_OF_LIST"
"ENVSPACE"
"EQUALS"
"EXCLUDE_SUBDIR"
"EXCLUSIVE"
"EXISTS"
"EXIT"
"EXTENDED_MEMORY"
"EXTENSION_ONLY"
"FAILIFEXISTS"
"FALSE"
"FEEDBACK_FULL"
"FILE_ATTR_ARCHIVED"
"FILE_ATTR_DIRECTORY"
"FILE_ATTR_HIDDEN"
"FILE_ATTR_NORMAL"
"FILE_ATTR_READONLY"
"FILE_ATTR_SYSTEM"
"FILE_ATTRIBUTE"
"FILE_DATE"
"FILE_LINE_LENGTH"
"FILE_MODE_APPEND"
"FILE_MODE_BINARYREADONLY"
"FILE_MODE_BINARY"
"FILE_MODE_NORMAL"
"FILE_NO_VERSION"
"FILE_NOT_FOUND"
"FILE_SIZE"
"FILE_TIME"
"FILENAME_ONLY"
"FILENAME"
"FIXED_DRIVE"
"FOLDER_DESKTOP"
"FOLDER_STARTMENU"
"FOLDER_STARTUP"
"FREEENVSPACE"
"FULLWINDOWMODE"
"FULL"
"FONT_TITLE"
"GREATER_THAN"
"GREEN"
"HOURGLASS"
"INCLUDE_SUBDIR"
"INDVFILESTATUS"
"INFORMATION"
"IS_WINDOWSNT"
"IS_WINDOWS95"
"IS_WINDOWS"
"IS_WIN32S"
"ISTYPE"
"LANGUAGE_DRV"
"LANGUAGE"
"LESS_THAN"
"LIST_NULL"
"LISTFIRST"
"LISTNEXT"
"LOCKEDFILE"
"LOGGING"
"LOWER_LEFT"
"LOWER_RIGHT"
"MAGENTA"
"MOUSE_DRV"
"MOUSE"
"NETWORK_DRV"
"NETWORK"
"NEXT"
"NONEXCLUSIVE"
"NORMALMODE"
"NOSET"
"NOTEXISTS"
"NOWAIT"
"NO"
"OFF"
"ONLYDIR"
"ON"
"OSMAJOR"
"OSMINOR"
"OS"
"OTHER_FAILURE"
"PARALLEL"
"PARTIAL"
"PATH_EXISTS"
"PATH"
"RED"
"REGDB_APPPATH_DEFAULT"
"REGDB_APPPATH"
"REGDB_BINARY"
"REGDB_ERR_CONNECTIONEXISTS"
"REGDB_ERR_CORRUPTEDREGSITRY"
"REGDB_ERR_INITIALIZATION"
"REGDB_ERR_INVALIDHANDLE"
"REGDB_ERR_INVALIDNAME"
"REGDB_NUMBER"
"REGDB_STRING_EXPAND"
"REGDB_STRING_MULTI"
"REGDB_STRING"
"REGDB_UNINSTALL_NAME"
"REMOTE_DRIVE"
"REMOVALE_DRIVE"
"REPLACE_ITEM"
"REPLACE"
"RESET"
"RESTART"
"ROOT"
"SELFREGISTER"
"SERIAL"
"SET"
"SEVERE"
"SHAREDFILE"
"SHARE"
"SILENTMODE"
"SRCTARGETDIR"
"STATUSBAR"
"STATUSDLG"
"STATUSOLD"
"STATUS"
"STYLE_NORMAL"
"SW_MAXIMIZE"
"SW_MINIMIZE"
"SW_RESTORE"
"SW_SHOW"
"TIME"
"TRUE"
"TYPICAL"
"UPPER_LEFT"
"UPPER_RIGHT"
"VALID_PATH"
"VERSION"
"VIDEO"
"VOLUMELABEL"
"YELLOW"
"YES"
"WAIT"
"WARNING"
"WINMAJOR"
"WINMINOR"
"WIN32SINSTALLED"
"WIN32SMAJOR"
"WIN32SMINOR"
)
"Function argument constants used in InstallShield 3 and 5.")
(define-generic-mode 'rul-generic-mode
;; Using "/*" and "*/" doesn't seem to be working right
(list "//")
'("abort"
"begin"
"call"
"case"
"declare"
"default"
"downto"
"elseif"
"else"
"endfor"
"endif"
"endswitch"
"endwhile"
"end"
"exit"
"external"
"for"
"function"
;; "goto" -- handled elsewhere
"if"
"program"
"prototype"
"repeat"
"return"
"step"
"switch"
"then"
"to"
"typedef"
"until"
"void"
"while")
;; Using "/*" and "*/" doesn't seem to be working right
(list "//")
installshield-statement-keyword-list
(list
;; preprocessor constructs
'("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
......@@ -687,502 +1195,20 @@ you must reload generic-x to enable the specified modes."
(2 font-lock-reference-face nil t))
;; system variables
(generic-make-keywords-list
(list
"CMDLINE"
"ERRORFILENAME"
"INFOFILENAME"
"ISRES"
"ISUSER"
"ISVERSION"
"SRCDIR"