File: keyval.el

package info (click to toggle)
mpqc 2.3.1-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 39,580 kB
  • ctags: 16,804
  • sloc: cpp: 258,686; sh: 8,584; perl: 6,017; ansic: 5,491; makefile: 2,769; fortran: 1,970; lisp: 1,269; yacc: 313; lex: 177; csh: 45
file content (78 lines) | stat: -rw-r--r-- 2,615 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
;;
;; keyval.el: Mode for MPQC input files
;;
;; Copyright (C) 1996 Limit Point Systems, Inc.
;;
;; Author: Curtis Janssen <cljanss@ca.sandia.gov>
;; Maintainer: SNL
;;
;; This file is part of MPQC.
;;
;; MPQC 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.
;;
;; MPQC 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 the MPQC; see the file COPYING.  If not, write to
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
;;
;; The U.S. Government is granted a limited license as per AL 91-7.
;;

;;;###autoload
(defvar keyval-mode-hook nil
  "*List of hook functions run by `keyval-mode' (see `run-hooks').")

(defvar keyval-mode-map
  (let ((map (make-sparse-keymap)))
    ;(define-key map " " 'scroll-up)
    ;(define-key map "\^?" 'scroll-down)
    map)
  "Keymap for KeyVal input buffers.")

(defun keyval-mode ()
  "Major mode for KeyVal input files."
  (interactive)
  (fundamental-mode)
  (use-local-map keyval-mode-map)
  (setq major-mode 'keyval-mode
	mode-name "KeyVal")
  (keyval-setup)
  (make-local-variable 'font-lock-defaults)
  (setq font-lock-defaults '(keyval-font-lock-keywords t t))
  (run-hooks 'keyval-mode-hook))

(defun keyval-setup ())

(defvar keyval-key-face 'keyval-key-face
  "Face for keys in KeyVal file.")
(make-face keyval-key-face)
(make-face-bold keyval-key-face)
(set-face-foreground keyval-key-face "Cyan")

(defvar keyval-classtype-face 'keyval-classtype-face
  "Face for names of classes in KeyVal file.")
(make-face keyval-classtype-face)
(set-face-foreground keyval-classtype-face "Green")

(defvar keyval-reference-face 'keyval-reference-face
  "Face for references in KeyVal file.")
(make-face keyval-reference-face)
(set-face-foreground keyval-reference-face "Orange")
(set-face-underline-p keyval-reference-face t)

(defvar keyval-font-lock-keywords
  '(("%.*" . font-lock-comment-face)
    ("<.*>" . keyval-classtype-face)
    ("\"[^\"\n]+\"" . font-lock-string-face)
    ("$[A-Za-z0-9_\.:*+-/]*" . keyval-reference-face)
    ("{ *\\([A-Za-z0-9_\.*+-/ ]*\\>\\) *} *=" (1 keyval-key-face))
    ("\\([A-Za-z0-9_\.*+-/]*\\>\\) *=" (1 keyval-key-face))
    )
  "Default expressions to highlight in KeyVal mode.")