1 ;;; ***********************************************************
 2 ;;; *                                                         *
 3 ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 4 ;;; *                                                         *
 5 ;;; * Copyright (c) 1978 by Massachusetts Institute of        *
 6 ;;; * Technology and Honeywell Information Systems, Inc.      *
 7 ;;; *                                                         *
 8 ;;; ***********************************************************
 9 
10 ;;;
11 
12 ;;; HISTORY COMMENTS:
13 ;;;  1) change(81-07-31,Hornig), approve(), audit(),
14 ;;;     install(86-08-20,MR12.0-1136):
15 ;;;     to separate electric-alm mode.
16 ;;;  2) change(84-12-27,Margolin), approve(86-02-24,MCR7186),
17 ;;;     audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136):
18 ;;;     to register and set mode-identification
19 ;;;     in alm-mode, as it is required by compile-buffer.
20 ;;;  3) change(85-01-27,Margolin), approve(86-02-24,MCR7186),
21 ;;;     audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136):
22 ;;;     to declare mode-identification special.
23 ;;;                                                      END HISTORY COMMENTS
24 
25 
26 (%include e-macros)
27 
28 (declare (special fill-column comment-column comment-prefix fill-prefix
29                   compiler compile-options mode-identification))
30 
31 (defvar alm-mode-hook nil)
32 
33 (defun alm-mode ()
34        (register-local-var 'compiler)
35        (register-local-var 'compile-options)
36        (register-local-var 'mode-identification)
37        (setq current-buffer-mode 'ALM compiler 'alm compile-options ""
38              mode-identification -3)
39        (setq comment-column 40. comment-prefix "")
40        (negate-minor-mode 'electric)
41        (set-key 'ESC-^C 'compile-buffer)
42        (if alm-mode-hook (errset (funcall alm-mode-hook))))
43 
44 (defun electric-alm-mode ()
45        (alm-mode)
46        (setq fill-prefix TAB)
47        (set-key ': 'alm-label-hacker)
48        (set-key '^M 'nl-nb-line)
49        (assert-minor-mode 'electric))
50 
51 (defun nl-nb-line ()
52        (and (eolp)(delete-white-sides))
53        (new-line))
54 
55 (defun alm-label-hacker ()
56        (save-excursion
57         (go-to-beginning-of-line)
58         (if (at-white-char)(delete-white-sides)))
59        (insert-string ":")
60        (format-to-col 10.))
61