# HG changeset patch # User Oleksandr Gavenko # Date 1268594214 -7200 # Node ID f833d68fa5ae21c56893f69345df38a629e224ff # Parent 6ae9e98a1d534588d7e3be0f71682584460abd2c# Parent 84db44766351fb6a520c788d33acb5d7c7c64ddc Automated merge with file:///E:\srv\hg\dot-emacs diff -r 6ae9e98a1d53 -r f833d68fa5ae .emacs-my --- a/.emacs-my Sun Mar 14 20:49:34 2010 +0200 +++ b/.emacs-my Sun Mar 14 21:16:54 2010 +0200 @@ -126,6 +126,8 @@ (setq read-quoted-char-radix 16) +(require 'generic-x) + ;; ---------------------------------------------------------------------- ;; switching, creating, selecting buffers. @@ -936,12 +938,7 @@ (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my"))) ;; ---------------------------------------------------------------------- -;; bat file, batch. - -(when (fboundp 'bat-file-mode) - (add-to-list 'auto-mode-alist '("\\.[bB][aA][tT]\\'" . bat-file-mode)) - (add-to-list 'auto-mode-alist '("\\.[cC][mM][dD]\\'" . bat-file-mode)) - ) +;; bat file, batch, loaded from 'generic-x.el'. ;; ---------------------------------------------------------------------- ;; nsis-mode. diff -r 6ae9e98a1d53 -r f833d68fa5ae bat-file-mode.el --- a/bat-file-mode.el Sun Mar 14 20:49:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -;;; bat-file-mode.el --- batch file major mode - -;; Copyright (C) 2010 by Oleksandr Gavenko - -;; You can do anything with this file without any warranty. - -;; Author: Oleksandr Gavenko -;; Maintainer: Oleksandr Gavenko -;; Created: 2010-01-28 -;; Version: 0.1 -;; Keywords: languages - -;;; Commentary: -;; -;; Very pure highlighting and not all available syntax. - -;;; Code: - -;;;###autoload -(define-generic-mode 'bat-file-mode - (list "REM " "rem " ":: ") - nil - '( - ("\\(:[[:alnum:]_]+\\)" (1 'font-lock-function-name-face)) - ("\\<\\([iI][fF]\\|[eE][lL][sS][eE]\\|[fF][oO][rR]\\|[iI][nN]\\|[dD][oO]\\|[gG][oO][tT][oO]\ -\\|[nN][oO][tT]\\|[eE][rR][rR][oO][rR][lL][eE][vV][eE][lL]\\|[eE][xX][iI][sS][tT]\ -\\|[dD][eE][fF][iI][nN][eE][dD]\\|[cC][mM][dD][eE][xX][tT][vV][eE][rR][sS][iI][oO][nN]\ -\\|[pP][aA][uU][sS][eE]\\|[eE][cC][hH][oO]\\|[pP][rR][oO][mM][pP][tT]\ -\\|[pP][rR][oO][mM][pP][tT]\\|[cC][aA][lL][lL]\\|[sS][eE][tT]\\|[sS][hH][iI][fF][tT]\\|[sS][tT][aA][rR][tT]\\|[eE][xX][iI][tT]\ -\\|[cC][dD]\\|[cC][hH][dD][iI][rR]\\|[pP][uU][sS][hH][dD]\\|[pP][oO][pP][dD]\\|[cC][lL][sS]\ -\\|[cC][mM][dD]\\|[vV][eE][rR]\ -\\|[dD][eE][lL][eE][tT][eE]\\|[dD][eE][lL]\\|[cC][oO][pP][yY]\ -\\)\\>" (1 'font-lock-keyword-face)) - ("\\(:[[:alpha:]][[:alnum:]_]*\\)" (1 'font-lock-function-name-face)) - ("[gG][oO][tT][oO][[:blank:]]+\\([[:alpha:]][[:alnum:]_]*\\)" (1 'font-lock-function-name-face)) - ("[cC][aA][lL][lL][[:blank:]]+\\(:[[:alpha:]][[:alnum:]_]*\\)" (1 'font-lock-function-name-face)) - ("\\(%[[:digit:]]\\|%%[[:alpha:]]\\|%[[:alpha:]][[:alnum:]_]*%\\)" (1 'font-lock-variable-name-face)) - ("[sS][eE][tT][[:blank:]]+\\([[:alpha:]][[:alnum:]_]*\\)[[:blank:]]*=" (1 'font-lock-variable-name-face)) - ;; Options for program like --help or /quiet. - ("[[:blank:]]+\\([-/]-?[[:alnum:]_.]+\\)" (1 'font-lock-preprocessor-face)) - ;; ("\\(\\%[a-z]\\)" (1 'font-lock-reference-face)) - ;; ("\\(%\\sw+%\\)" (1 'font-lock-reference-face)) - ;; ("\\(%[0-9]\\)" (1 'font-lock-reference-face)) - ) - (list "\\.\\([bB][aA][tT]\\|[cC][mM][dD]\\)$") - nil - "Generic mode for batch files.") - -(add-hook - 'bat-file-mode-hook - (lambda () - (modify-syntax-entry ?\" "\"") - (modify-syntax-entry ?' "\"") - (modify-syntax-entry ?\\ "\\") - (modify-syntax-entry ?% ".") - (modify-syntax-entry ?= ".") - (modify-syntax-entry ?_ "w") - ) - ) - -(provide 'bat-file-mode) - -;;; bat-file-mode.el ends here