Initial Commit
[packages] / xemacs-packages / ilisp / ilisp-cmu.el
1 ;;; -*- Mode: Emacs-Lisp -*-
2
3 ;;; ilisp-cmu.el --
4 ;;; ILISP CMU Common Lisp dialect definition
5 ;;;
6 ;;;
7 ;;; This file is part of ILISP.
8 ;;; Please refer to the file COPYING for copyrights and licensing
9 ;;; information.
10 ;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
11 ;;; of present and past contributors.
12 ;;;
13 ;;; $Id: ilisp-cmu.el,v 1.4 2002-06-03 23:37:00 wbd Exp $
14
15 (defvar cmulisp-source-directory-regexp 
16   "\\/afs\\/cs\\.cmu\\.edu\\/project\\/clisp\\/src\\/[0-9]*\\/"
17   "*Regexp to match cmulisp source code directory.")
18
19 (defvar cmulisp-local-source-directory
20   nil
21   "*Where the cmulisp sources really are.")
22
23 (defvar ilisp-cmulisp-init-file "cmulisp")
24
25 (defun cmulisp-source-directory-fixup-function ()
26   (if cmulisp-local-source-directory
27       (replace-match cmulisp-local-source-directory)))
28
29 (defun cmulisp-check-prompt (old new)
30   "Compare the break level printed at the beginning of the prompt."
31   (let* ((was-in-break (and old (string-match "]+" old)))
32          (old-level (if was-in-break
33                         (- (match-end 0) (match-beginning 0))
34                         0))
35          (is-in-break (string-match "]+" new))
36          (new-level (if is-in-break
37                         (- (match-end 0) (match-beginning 0))
38                         0)))
39     (<= new-level old-level)))
40
41 ;;;
42 (defdialect cmulisp "CMU Common LISP"
43   common-lisp
44   (ilisp-load-init 'cmu ilisp-cmulisp-init-file)
45   (if cmulisp-local-source-directory
46       (setq ilisp-source-directory-fixup-alist
47             (list 
48              (cons cmulisp-source-directory-regexp
49                    cmulisp-local-source-directory)))
50     (message "cmulisp-local-source-directory not set."))
51   (setq comint-prompt-regexp "^\\([0-9]+\\]+\\|\\*\\|[-a-zA-Z0-9]*\\[[0-9]+\\]:\\) "
52         ilisp-trace-command "(ILISP:cmulisp-trace \"%s\" \"%s\" \"%s\")"
53         comint-prompt-status 
54         (function (lambda (old line)
55                     (comint-prompt-status old line 'cmulisp-check-prompt)))
56
57         ilisp-error-regexp "ILISP:[^\"]*\\|Error [^\n]*\n\n"
58         ;; The above regexp has been suggested by
59         ;; hunter@work.nlm.nih.gov (Larry Hunter)
60
61
62         ;; 19991219 Marco Antoniotti
63         ;; Changed the very low level call to ARGLIST to the more
64         ;; sophisticated ILISP-ARGLIST.
65
66         ;; ilisp-arglist-command "(ILISP:arglist \"%s\" \"%s\")"
67         ilisp-arglist-command "(ILISP:ilisp-arglist \"%s\" \"%s\")"
68
69         ilisp-directory-command "(namestring (ext:default-directory))"
70         ilisp-set-directory-command "(setf (ext:default-directory) \"%s\")"
71
72         ilisp-find-source-command "(ILISP:source-file \"%s\" \"%s\" \"%s\")"
73
74         comint-fix-error ":pop"
75
76         comint-continue ":go"
77
78         ilisp-reset ":q"
79
80         comint-interrupt-regexp "Interrupted at"
81
82         ;; Note:
83         ;; 19990920
84         ;; The global definition should now take care to find out the
85         ;; proper extension.  See file 'ilisp-cl.el'.
86         ;;
87         ;; 19990806 Marco Antoniotti
88         ;; As Martin Atzmueller has pointed out, these hardcoded
89         ;; constraints are very nasty.
90         ;; However, before hacking the code right here, I'd like to
91         ;; see an all-out solution to the binary file extension problem.
92
93         ;; ilisp-binary-extension "sparcf"
94         ;; ilisp-init-binary-extension "sparcf"
95         ;; ilisp-binary-command "\"sparcf\""
96         )
97
98   ;; ILD Support
99
100   (setq ild-abort-string ":abort"
101         ild-continue-string ":go"
102         ild-step-string ":step"
103         ild-step-string-arg nil
104         ild-next-string ":down"
105         ild-next-string-arg nil         ; needs work
106         ild-previous-string ":up"
107         ild-previous-string-arg nil     ; needs work
108         ild-top-string ":bottom"
109         ild-bottom-string ":top"
110         ild-backtrace-string ":backtrace"
111         ild-locals-string ":l"
112         ild-local-string-arg "(debug:arg %s)"
113         ild-return-string nil           ; needs work (debug:debug-return x)
114         ild-retry-string nil            ; needs work
115         ild-trap-on-exit-string nil     ; needs work
116         )
117   )
118
119 ;;; end of file -- ilisp-cmu.el --