;;; wm-mode.el --- Major mode for mwm, twm and ctwm config files ;; Copyright (C) 1999, 2001 Stéphane Levant ;; Author: Stéphane Levant ;; Created: 1999 ;; Keywords: languages ;; Version: 1.1 ;; URL: http://arsunik.free.fr/emacs ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Windows Manager Mode: For mwm, twm and ctwm config files ;; INSTALL: Adds this lines to your .emacs : ;; (autoload 'wm-mode "wm-mode" "" t) ;; (setq auto-mode-alist ;; (cons '("[tm]wmrc" . wm-mode) auto-mode-alist)) ;; ;;; Code: (defvar wm-mode-hook nil) (defvar wm-mode-syntax-table nil) (if wm-mode-syntax-table () (setq wm-mode-syntax-table (make-syntax-table)) (modify-syntax-entry ?= "." wm-mode-syntax-table) (modify-syntax-entry ?| "." wm-mode-syntax-table) (modify-syntax-entry ?# "<" wm-mode-syntax-table) (modify-syntax-entry ?\n ">" wm-mode-syntax-table)) (defvar wm-font-lock-keywords '(( "^###.*$" 0 font-lock-title-face t) ( "^\\<\\([Mm]enu\\|[Ff]unction\\)\\>" 1 font-lock-function-name-face) ( "^[ \t]*\\([a-zA-Z]+\\)[ \t\n{]" 1 font-lock-builtin-face) ( "\\<\\(f\\.exec\\|!\\)\\>" . font-lock-constant-face) ( "\\" . font-lock-keyword-face) ( "\\<\\(root\\|icon\\|window\\|title\\|frame\\|border\\|app\ \\|all\\|iconmgr\\)\\>" 1 font-lock-type-face))) (cond ((not (facep 'font-lock-title-face)) (defvar font-lock-title-face 'font-lock-title-face) (copy-face 'bold 'font-lock-title-face))) ;;;###autoload (defun wm-mode () (interactive) "Windows Manager Mode: For mwm, twm and ctwm config files" (kill-all-local-variables) (set-syntax-table wm-mode-syntax-table) (make-local-variable 'comment-start) (make-local-variable 'font-lock-defaults) (setq comment-start "#" major-mode 'wm-mode mode-name "Twm" font-lock-defaults '(wm-font-lock-keywords nil nil nil)) (run-hooks 'wm-mode-hook)) ;;; wm-mode.el ends here