FVWM: Re: fvwm.el

From: Dave Goldberg <dsg_at_linus.mitre.org>
Date: Tue, 28 May 1996 10:36:35 -0400

--Multipart_Tue_May_28_10:36:31_1996-1
Content-Type: text/plain; charset=US-ASCII


I think the attached is what you are asking for. Note that with emacs
19.30 I had to do

(add-hook 'winmgr-mode-hook
          '(lambda ()
             (setq font-lock-defaults
                   '(winmgr-font-lock-keywords nil nil nil nil))
             (turn-on-font-lock)))

instead of the hook mentioned in the source file.

Dave Goldberg
Post: The Mitre Corporation\MS B305\202 Burlington Rd.\Bedford, MA 01730
Phone: 617-271-3887
Email: dsg_at_mitre.org

--Multipart_Tue_May_28_10:36:31_1996-1
Content-Type: application/octet-stream; type=emacs-lisp
Content-Disposition: attachment; filename="winmgr-mode.el"
Content-Transfer-Encoding: 7bit

;;; winmgr-mode.el -- window manager mode and the font lock configurations

;; Maintainer: David Konerding (rafael_at_cse.ucsc.edu)
;; Modifications by: Stefan Strobel <strobel_at_lia.univ-savoie.fr>

;;; Commentary:

;; This package is a major mode for editing window configuration files and
;; also defines font-lock keywords for such files.

;; winmgr-mode mode will automatically get turned on if you visit a
;; a file whose name looks like that of a configuration file
;; (IE, .fvwmrc, .mwmrc, .tvtwmrc, etc)

;; The current font-lock keywords are:

;; any word of upper or lower case letters at the start of a line
;; followed by whitespace gets colored using
;; font-lock-function-name-face.

;; any word of upper or lower case letters at the start of a line
;; followed by a "(" (IE, an m4 macro) gets colored using
;; font-lock-comment-face

;; Put this in your .emacs :
;;
;;(setq auto-mode-alist
;; (append '(("\\.[A-Za-z]*wm$" . winmgr-mode)
;; ("\\.[A-Za-z]*wmrc" . winmgr-mode)
;; auto-mode-alist))
;;
;;(autoload 'winmgr-mode "winmgr-mode"
;; "Mode for editing window manager config files")
;;
;;(add-hook 'winmgr-mode-hook
;; '(lambda ()
;; (font-lock-mode t)
;; (setq font-lock-keywords winmgr-font-lock-keywords)
;; (font-lock-fontify-buffer)))
;;


;;; Code:


(defvar winmgr-mode-hook nil
  "Hook to be run when mode is entered")


(defvar font-lock-m4-face 'default
  "new face for m4 macros")

(condition-case nil
    (progn
      (copy-face 'default 'm4-face)
      (set-face-foreground 'm4-face "blue")
      (set-face-background 'm4-face "white")
      (setq font-lock-m4-face 'm4-face))
  (error nil))

(defvar winmgr-font-lock-keywords
  '(("^[A-Za-z]+[ \n\t]" . font-lock-function-name-face)
    ("^#.*" . font-lock-comment-face)
    ("^[A-Za-z]+(.*)" . font-lock-m4-face))
  "default font-lock keywords")

(defun winmgr-mode ()
  "Major mode for editing winmgr config files"
  (interactive)
  (kill-all-local-variables)
  (setq mode-name "Winmgr")
  (setq major-mode 'winmgr-mode)
  (run-hooks 'winmgr-mode-hook))

(provide 'winmgr-mode)

--Multipart_Tue_May_28_10:36:31_1996-1--
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Sat Jun 01 1996 - 14:26:12 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST