Initial Commit
[packages] / xemacs-packages / ilisp / ilisp-kcl.el
1 ;;; -*- Mode: Emacs-Lisp -*-
2
3 ;;; ilisp-kcl.el --
4 ;;; ILISP Kyoto Common Lisp dialect definition and derivative.
5 ;;;
6 ;;; This file is part of ILISP.
7 ;;; Please refer to the file COPYING for copyrights and licensing
8 ;;; information.
9 ;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
10 ;;; of present and past contributors.
11 ;;;
12 ;;; $Id: ilisp-kcl.el,v 1.4 2002-06-03 23:37:01 wbd Exp $
13
14 ;;;%%%KCL--these dialects by Tom Emerson
15 ;;; kcl-check-prompt doesn't after the first break because the
16 ;;; number of ">" characters doesn't increase.
17
18 (defun kcl-check-prompt (old new)
19   "Compare the break level printed at the beginning of the prompt."
20   (let* ((was-in-break (and old (string-match ">+" old)))
21          (old-level (if was-in-break
22                         (- (match-end 0) (match-beginning 0))
23                         0))
24          (is-in-break (string-match ">+" new))
25          (new-level (if is-in-break
26                         (- (match-end 0) (match-beginning 0))
27                         0)))
28     (<= new-level old-level)))
29
30 ;;;
31 (defdialect kcl "Kyoto Common LISP" common-lisp
32   (setq comint-prompt-regexp "^>+"
33         ilisp-error-regexp "Error: [^\n]*"
34         ilisp-binary-extension "o"
35         ilisp-init-binary-extension "o"
36         ilisp-binary-command "\"o\""
37         comint-fix-error ":q"
38         comint-continue ":r"
39         comint-prompt-status
40         (function
41          (lambda (old line)
42            (comint-prompt-status old line 'kcl-check-prompt)))))
43 (if (not kcl-program) (setq kcl-program "kcl"))
44
45 ;;;%%%AKCL
46 (defdialect akcl "Austin Kyoto Common LISP" kcl
47   (setq comint-prompt-regexp "^[-A-Z]*>+")
48
49   ;; ILD Support
50
51   (setq ild-abort-string ":q"
52         ild-continue-string ":r"
53         ild-next-string ":up"
54         ild-next-string-arg ":up %s"
55         ild-previous-string ":down"
56         ild-previous-string-arg ":down %s"
57         ild-top-string ":down 1000000"
58         ild-bottom-string ":up 1000000"
59         ild-backtrace-string ":bt"
60         ild-locals-string ":fr"
61         ild-local-string-arg ":loc %s"
62         ild-return-string ":r"
63         ild-retry-string nil            ; needs work
64         ild-trap-on-exit-string nil     ; needs work
65         )
66    )
67 (if (not akcl-program) (setq akcl-program "akcl"))
68
69
70 ;;;%%%IBCL
71 (defdialect ibcl "Ibuki Common LISP" kcl
72   (setq comint-prompt-regexp "^[-A-Z]*>+\\|^[-A-Z]* ->"
73         comint-interrupt-regexp ">>Condition: Terminal Interrupt"
74         comint-continue ":q"
75         ilisp-reset ":q!"
76         ilisp-error-regexp ">>Error:[^\n]*"))
77 (if (not ibcl-program) (setq ibcl-program "ibcl"))
78
79
80 ;;; GCL and ECL (at least) have slightly different compilers and
81 ;;; runtimes, hence we need to provide different extensions for their
82 ;;; init files.
83 ;;; Marco Antoniotti <marcoxa@icsi.berkeley.edu> 19951028.
84
85 ;;; GCL -- I assume it is exactly as AKCL.
86 ;;; Should check whether it is similar to IBUKI.
87
88 (defdialect gcl "GNU Common LISP" akcl
89   (setq comint-prompt-regexp "^>+"
90         ilisp-binary-extension "o"
91         ilisp-init-binary-extension "gcl.o"
92         ilisp-binary-command "\"o\""
93         ilisp-init-binary-command "\"gcl.o\""
94         )
95
96   ;; ILD Support
97
98   (setq ild-abort-string ":q"
99         ild-continue-string ":r"
100         ild-next-string ":up"
101         ild-next-string-arg ":up %s"
102         ild-previous-string ":down"
103         ild-previous-string-arg ":down %s"
104         ild-top-string ":down 1000000"
105         ild-bottom-string ":up 1000000"
106         ild-backtrace-string ":bt"
107         ild-locals-string ":fr"
108         ild-local-string-arg ":loc %s"
109         ild-return-string ":r"
110         ild-retry-string nil            ; needs work
111         ild-trap-on-exit-string nil     ; needs work
112         )
113   )
114
115 (if (not gcl-program) (setq gcl-program "gcl"))
116
117
118 ;;; ECL -- Beppe Attardi's developments over AKCL
119 ;;;        Currently maintained by Juan Jose Garcia-Ripoll
120
121 (defdialect ecl "EcoLisp Common LISP" akcl
122   (setq comint-prompt-regexp "^\\([A-Z].*\\)?>+ "
123         ilisp-error-regexp "Broken at [^\n]*"
124         comint-fix-error ":pop\n(progn (terpri) (values))") ; kludge
125
126   ;; ILD Support.
127
128   (setq ild-abort-string ":q"
129         ild-continue-string ":r"
130         ild-next-string ":up"
131         ild-next-string-arg ":up %s"
132         ild-previous-string ":down"
133         ild-previous-string-arg ":down %s"
134         ild-top-string ":down 1000000"
135         ild-bottom-string ":up 1000000"
136         ild-backtrace-string ":bt"
137         ild-locals-string ":fr"
138         ild-local-string-arg ":loc %s"
139         ild-return-string ":r"
140         ild-retry-string nil            ; needs work
141         ild-trap-on-exit-string nil     ; needs work
142         )
143   )
144
145 (if (not ecl-program) (setq ecl-program "ecl"))
146
147 ;;; end of file -- ilisp-kcl.el --