nsis-mode.el
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 07 Mar 2010 10:58:13 +0200
changeset 323 7a7dc2befa99
parent 320 2c4a6d477785
child 650 d21c5ae9b7e6
permissions -rw-r--r--
Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet repository tree. So it must be installed manually. My usually configuration install user local software into ~/usr DISTDIR.

;;; iar-linker-config-mode.el --- major mode for highlighting NSIS scripts

;; Copyright (C) 2009, 2010 by Oleksandr Gavenko <gavenkoa@gmail.com>

;; You can do anything with this file without any warranty.

;; Author: Oleksandr Gavenko <gavenkoa@gmail.com>
;; Maintainer: Oleksandr Gavenko <gavenkoa@gmail.com>
;; Created: 2009-09-14
;; Version: 0.1
;; Keywords: languages

;;; Commentary:
;;
;; Very pure syntax highlighting.

;;; Code:

;;;###autoload
(define-generic-mode 'nsis-mode
  (list ?\; ?\# '("/*" . "*/"))
  '(
    "Section" "SectionEnd" "SectionIn" "SectionGroup" "SectionGroupEnd" "Function" "FunctionEnd" "File"
    "SectionSetFlags" "SectionGetFlags" "SectionSetText" "SectionGetText" "SectionSetInstTypes" "SectionGetInstTypes" "SectionSetSize" "SectionGetSize" "SetCurInstType" "GetCurInstType" "InstTypeSetText" "InstTypeGetText"
    "Name" "ShowInstDetails" "Caption"
    "LicenseText" "LicenseData" "LicenseForceSelection" "ComponentText" "BrandingText" "DetailsButtonText" "CompletedText" "UninstallText"
    "DirText" "DirVar" "DirVerify"
    "Exec" "ExecWait" "ExecShell" "Goto" "goto" "Call" "Return" "Abort" "Quit" "ClearErrors" "SetErrors"
    "Reboot" "SetRebootFlag"
    "IfSilent" "IfAbort" "IfRebootFlag" "IfErrors" "IfFileExists"
    "GetCurrentAddress" "GetFunctionAddress" "GetLabelAddress"
    "Page" "UninstPage" "PageEx" "PageCallbacks" "PageExEnd"
    "Delete" "CopyFiles" "CreateDirectory" "RMDir" "OutFile" "ReserveFile" "CreateShortCut"
    "CallInstDLL" "GetDLLVersion" "GetDLLVersionLocal" "RegDLL" "UnRegDLL"
    "GetFileTime" "GetFileTimeLocal" "GetFullPathName" "GetTempFileName" "SearchPath" "SetFileAttributes"
    "ReadRegStr" "WriteRegStr" "DeleteRegKey" "DeleteRegValue" "EnumRegKey" "EnumRegValue" "WriteRegDWORD" "ReadRegDWORD" "WriteRegDword" "WriteRegBin" "WriteRegDWORD" "WriteRegExpandStr"
    "ExpandEnvStrings" "ReadEnvStr"
    "DeleteINISec" "DeleteINIStr" "FlushINI" "ReadINIStr" "WriteINIStr"
    "Var" "Pop" "Push" "Exch"
    "StrLen" "StrCpy" "StrCmp" "StrCmpS" "IntCmp" "IntCmpU" "IntFmt" "IntOp"
    "FileClose" "FileOpen" "FileRead" "FileReadByte" "FileSeek" "FileWrite" "FileWriteByte" "FindClose" "FindFirst" "FindNext"
    "InitPluginsDir" "addplugindir" "InstallDir" "InstallDirRegKey" "InstType" "Nop" "Sleep"
    "RequestExecutionLevel" "CRCCheck" "XPStyle"
    "ReadIniStr" "WriteIniStr"
    "LogSet" "LogText"
    "Icon" "UninstallIcon"
    "SendMessage" "MessageBox" "GetDlgItem"
    "FindWindow" "EnableWindow" "LockWindow" "ShowWindow" "HideWindow" "IsWindow" "AutoCloseWindow"
    "SetAutoClose" "CreateFont" "SetCtlColors" "SetBrandingImage" "SetDetailsView" "SetDetailsPrint" "SetSilent" "BringToFront" "DetailPrint"
    "LoadLanguageFile" "LangString" "LicenseLangString"
    "SubCaption" "UninstallSubCaption"
    "SetPluginUnload" "DetailPrint" "SetOutPath" "WriteUninstaller"
    "GetErrorLevel" "SetErrorLevel" "GetInstDirError" "SetRegView" "SetShellVarContext"
    "SetDateSave" "SetDatablockOptimize" "BGGradient" "InstallColors" "CheckBitmap" "SilentInstall" "SetOverwrite"
    "SetCompress"
    )
  '(
    ("!\\(insertmacro\\|define\\|ifdef\\|ifndef\\|else\\|endif\\|echo\\|verbose\\|include\\|macroend\\|macro\\|undef\\|packhdr\\|warning\\|error\\)" (1 'font-lock-builtin-face))
    ("$[({]?\\([A-Za-z0-9_]+\\)[)}]?" (1 'font-lock-variable-name-face))
    ("^[[:blank:]]*\\([[:alpha:].][[:alnum:]_.]*:\\)\\([^:]\\|$\\)" (1 'font-lock-function-name-face))
    ("^[[:blank:]]*\\(Function\\|Goto\\|Call\\)[[:blank:]]+\\([[:alnum:]_.]*\\)" (2 'font-lock-function-name-face))
    )
  (list "\\.\\(nsi\\|nsh\\)$")
  nil
  "Generic mode for nsis files.")

(add-hook
 'nsis-mode-hook
 (lambda ()
   (modify-syntax-entry ?_ "w")
   (modify-syntax-entry ?. "w")
   )
 )

(provide 'nsis-mode)

;;; nsis-mode.el ends here