1 | ;;
|
---|
2 | ;; mpqc.el: mode for editing MPQC output files
|
---|
3 | ;;
|
---|
4 | ;; Copyright (C) 1996 Limit Point Systems, Inc.
|
---|
5 | ;;
|
---|
6 | ;; Author: Curtis Janssen <cljanss@ca.sandia.gov>
|
---|
7 | ;; Maintainer: SNL
|
---|
8 | ;;
|
---|
9 | ;; This file is part of MPQC.
|
---|
10 | ;;
|
---|
11 | ;; MPQC is free software; you can redistribute it and/or modify
|
---|
12 | ;; it under the terms of the GNU General Public License as published by
|
---|
13 | ;; the Free Software Foundation; either version 2, or (at your option)
|
---|
14 | ;; any later version.
|
---|
15 | ;;
|
---|
16 | ;; MPQC is distributed in the hope that it will be useful,
|
---|
17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | ;; GNU General Public License for more details.
|
---|
20 | ;;
|
---|
21 | ;; You should have received a copy of the GNU General Public License
|
---|
22 | ;; along with the MPQC; see the file COPYING. If not, write to
|
---|
23 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
24 | ;;
|
---|
25 | ;; The U.S. Government is granted a limited license as per AL 91-7.
|
---|
26 | ;;
|
---|
27 |
|
---|
28 | ;;;###autoload
|
---|
29 | (defvar mpqc-mode-hook nil
|
---|
30 | "*List of hook functions run by `mpqc-mode' (see `run-hooks').")
|
---|
31 |
|
---|
32 | (defvar mpqc-mode-map
|
---|
33 | (let ((map (make-sparse-keymap)))
|
---|
34 | (define-key map " " 'scroll-up)
|
---|
35 | (define-key map "\^?" 'scroll-down)
|
---|
36 | map)
|
---|
37 | "Keymap for mpqc output buffers.")
|
---|
38 |
|
---|
39 | (defun mpqc-mode ()
|
---|
40 | "Major mode for mpqc output files."
|
---|
41 | (interactive)
|
---|
42 | (fundamental-mode)
|
---|
43 | (use-local-map mpqc-mode-map)
|
---|
44 | (setq major-mode 'mpqc-mode
|
---|
45 | mode-name "Mpqc")
|
---|
46 | (mpqc-setup)
|
---|
47 | (make-local-variable 'font-lock-defaults)
|
---|
48 | (setq font-lock-defaults '(mpqc-font-lock-keywords t))
|
---|
49 | (run-hooks 'mpqc-mode-hook))
|
---|
50 |
|
---|
51 | (defun mpqc-setup ()
|
---|
52 | (toggle-read-only 1)
|
---|
53 | )
|
---|
54 |
|
---|
55 | (defvar mpqc-classtype-face 'mpqc-classtype-face
|
---|
56 | "Face for names of classes in MPQC output.")
|
---|
57 | (make-face mpqc-classtype-face)
|
---|
58 | (set-face-foreground mpqc-classtype-face "Green")
|
---|
59 |
|
---|
60 | (defvar mpqc-key-face 'mpqc-key-face
|
---|
61 | "Face for keys in MPQC output.")
|
---|
62 | (make-face mpqc-key-face)
|
---|
63 | (make-face-bold mpqc-key-face)
|
---|
64 | (set-face-foreground mpqc-key-face "Cyan")
|
---|
65 |
|
---|
66 | (defvar mpqc-success-face 'mpqc-success-face
|
---|
67 | "Face for usable mpqc output.")
|
---|
68 | (make-face mpqc-success-face)
|
---|
69 | (set-face-foreground mpqc-success-face "Green")
|
---|
70 |
|
---|
71 | (defvar mpqc-coor-face 'mpqc-coor-face
|
---|
72 | "Face for names of simple internal coordinates in MPQC output.")
|
---|
73 | (make-face mpqc-coor-face)
|
---|
74 | (make-face-bold mpqc-coor-face)
|
---|
75 | (set-face-foreground mpqc-coor-face "Green")
|
---|
76 |
|
---|
77 | (defvar mpqc-info-face 'mpqc-info-face
|
---|
78 | "Face for informational messages in MPQC output.")
|
---|
79 | (make-face mpqc-info-face)
|
---|
80 | (set-face-foreground mpqc-info-face "Orange")
|
---|
81 |
|
---|
82 | (defvar mpqc-warning-face 'mpqc-warning-face
|
---|
83 | "Face for warnings in MPQC output.")
|
---|
84 | (make-face mpqc-warning-face)
|
---|
85 | (set-face-foreground mpqc-warning-face "Red")
|
---|
86 |
|
---|
87 | (defvar mpqc-error-face 'mpqc-error-face
|
---|
88 | "Face for errors in MPQC output.")
|
---|
89 | (make-face mpqc-error-face)
|
---|
90 | (make-face-bold mpqc-error-face)
|
---|
91 | (set-face-foreground mpqc-error-face "Red")
|
---|
92 |
|
---|
93 | (defvar mpqc-plain-face 'mpqc-plain-face
|
---|
94 | "Face for plain MPQC output.")
|
---|
95 | (make-face mpqc-plain-face)
|
---|
96 | (set-face-foreground mpqc-plain-face "White")
|
---|
97 |
|
---|
98 | (defvar mpqc-font-lock-keywords
|
---|
99 | '(
|
---|
100 | (".*have been met.*" . mpqc-success-face)
|
---|
101 | (".*iter.*$" . mpqc-plain-face)
|
---|
102 | ("<.*>" . mpqc-classtype-face)
|
---|
103 | ("\"[^\"\n]+\"" . font-lock-string-face)
|
---|
104 | ("\\(.*::.*\\) *=\\(.*\\)" (1 mpqc-info-face) (2 mpqc-success-face))
|
---|
105 | ("\\(total scf energy\\) = \\(.*\\)"
|
---|
106 | (1 mpqc-info-face) (2 mpqc-success-face))
|
---|
107 | ("\\(nuclear repulsion energy\\) = \\(.*\\)"
|
---|
108 | (1 mpqc-info-face) (2 mpqc-success-face))
|
---|
109 | ("\\(taking step of size\\) \\(.*\\)"
|
---|
110 | (1 mpqc-info-face) (2 mpqc-success-face))
|
---|
111 | ("\\(Value of the .*\\): \\(.*\\)"
|
---|
112 | (1 mpqc-info-face) (2 mpqc-success-face))
|
---|
113 | ("\\(\\(HOMO\\|LUMO\\) is\\) \\(.*\\) = \\(.*\\)"
|
---|
114 | (1 mpqc-info-face) (3 mpqc-key-face) (4 mpqc-success-face))
|
---|
115 | ("\\(\\(Max\\|RMS\\) .*\\):" (1 mpqc-info-face))
|
---|
116 | ("{ *\\([A-Za-z0-9_\.*+-/ ]*\\>\\) *} *=" (1 mpqc-key-face))
|
---|
117 | ("\\([A-Za-z0-9_\.*+-/]*\\>\\) *=" (1 mpqc-key-face))
|
---|
118 | (" no$" . mpqc-warning-face)
|
---|
119 | (" yes$" . mpqc-success-face)
|
---|
120 | (".*has converged.*" . mpqc-success-face)
|
---|
121 | (".*has NOT converged.*" . mpqc-error-face)
|
---|
122 | ("DEBUG.*" . mpqc-warning-face)
|
---|
123 | ("WARNING.*" . mpqc-warning-face)
|
---|
124 | ("NOTICE.*" . mpqc-warning-face)
|
---|
125 | ("TORS" . mpqc-coor-face)
|
---|
126 | ("BEND" . mpqc-coor-face)
|
---|
127 | ("STRE" . mpqc-coor-face)
|
---|
128 | ("OUTP" . mpqc-coor-face)
|
---|
129 | )
|
---|
130 | "Default expressions to highlight in MPQC mode.")
|
---|