-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenmcl-init.lisp
157 lines (130 loc) · 5.23 KB
/
openmcl-init.lisp
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
;;****************************************************************************
;;FILE: .openmcl-init.lisp
;;LANGUAGE: Common-Lisp
;;SYSTEM: OpenMCL
;;USER-INTERFACE: None
;;DESCRIPTION
;;
;; The OpenMCL init file.
;;
;;AUTHORS
;; <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
;;MODIFICATIONS
;; 2003-12-18 <PJB> Adapted from .clisprc to .openmcl-init.
;; 2003-05-02 <PJB> Created.
;;BUGS
;;LEGAL
;; GPL
;;
;; Copyright Pascal Bourguignon 2003 - 2003
;; mailto:pjb@informatimago.com
;;
;; This program 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 of the License, or (at your option) any later version.
;;
;; This program 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 this program; if not, write to the Free
;; Software Foundation, Inc., 59 Temple Place, Suite 330,
;; Boston, MA 02111-1307 USA
;;****************************************************************************
;;----------------------------------------------------------------------
;; Setting environment -- COMMON-LISP part --
;; ------------------------------------------
(SETQ *LOAD-VERBOSE* NIL)
(LOAD (MERGE-PATHNAMES
(MAKE-PATHNAME :DIRECTORY '(:RELATIVE "RC") :NAME "COMMON" :TYPE "LISP"
:CASE :COMMON)
(USER-HOMEDIR-PATHNAME)
NIL))
(in-package "COM.INFORMATIMAGO.PJB")
(export '(EDIT QUIT))
(setf *shell* 'uiop:run-program)
;; ---------------------------------------------------------------------
;; clocc defsystem is erroneous for clisp --
;; -----------------------------------------
;;; (format t "~&tr=~S~%" (logical-pathname-translations "DEFSYSTEM"))
;;; (format t "~&dir=~S~%" (directory "DEFSYSTEM:*.*"))
;;; (LOAD "DEFSYSTEM:DEFSYSTEM.LISP")
;;; (SETQ MK::*FILENAME-EXTENSIONS* '("lisp" . "fas"))
;;; (MK::DEFINE-LANGUAGE :LISP
;;; :COMPILER #'COMPILE-FILE
;;; :LOADER #'LOAD
;;; :SOURCE-EXTENSION (CAR MK::*FILENAME-EXTENSIONS*)
;;; :BINARY-EXTENSION (CDR MK::*FILENAME-EXTENSIONS*))
;;; (UNLESS (FIND-PACKAGE "MK") (DEFPACKAGE "MK"))
;;; (DEFUN LOAD-MK ()
;;; (LOAD "DEFSYSTEM:DEFSYSTEM.LISP")
;;; (LET ((FE '("lisp" . "fas")))
;;; (DEFVAR MK::*FILENAME-EXTENSIONS* FE)
;;; (MK::DEFINE-LANGUAGE :LISP
;;; :COMPILER #'COMPILE-FILE
;;; :LOADER #'LOAD
;;; :SOURCE-EXTENSION (CAR FE)
;;; :BINARY-EXTENSION (CDR FE)))
;;; );;LOAD-MK
;;----------------------------------------------------------------------
;; Setting environment -- OpenMCL specific --
;; ------------------------------------------
;; We'll use clocc xlib\clx\clue
;; (WHEN (FIND-PACKAGE "XLIB") (DELETE-PACKAGE (FIND-PACKAGE "XLIB")))
(def-lp-trans "CCL" "/usr/local/lib/" "ccl/")
(def-lp-trans "COCOA" "/usr/local/lib/" "ccl/examples/")
(def-lp-trans "EXAMPLES" "/usr/local/lib/" "ccl/examples/")
(setf COMMON-LISP-USER::*default-bundle-path* "CCL:OPENMCL.APP;")
;; ccl::*module-search-path* ;; paths used by REQUIRE.
#|
From: John DeSoi <jd@icx.net>
Note: Do not put any semicolon comments before this line.
The next forms define a semicolon reader for both #\linefeed
and #\return line endings so that OpenMCL can read MCL input
files (Mac line endings). Should also work with with MCL for unix files.
We could try (setf CCL::*LINEFEED-EQUALS-NEWLINE* t)
|#
(defun semicolon-reader (stream char)
(declare (ignore char))
(do ((c #\null)) ((or (char= c #\linefeed) (char= c #\return)))
(setf c (read-char stream nil #\newline t)))
(values))
(set-macro-character #\; #'semicolon-reader)
;;----------------------------------------------------------------------
;; EDIT --
;; -------
;; editor-name is redefined in config.lisp to be:
;; (defun editor-name () (or (getenv "EDITOR") *editor*))
(DEFUN GET-FIRST-WORD (STRING)
"
RETURN: The first word of the string, or the empty string.
"
(DO ((I 0)
(J 0)
(FOUND NIL)
(DONE NIL))
(DONE (IF FOUND (SUBSEQ STRING I J) ""))
(IF (<= (LENGTH STRING) I)
(SETQ DONE T FOUND NIL)
(IF (<= J I)
(IF (ALPHA-CHAR-P (CHAR STRING I))
(SETQ J (1+ I))
(INCF I))
(IF (<= (LENGTH STRING) J)
(SETQ DONE T FOUND T)
(IF (ALPHA-CHAR-P (CHAR STRING J))
(INCF J)
(SETQ DONE T FOUND T)))))))
(defun edit (&optional (x nil x-p))
(declare (ignore x x-p))
(format *error-output* "~&Not implemented yet.~%"))
(defun quit () (ccl:quit))
;;----------------------------------------------------------------------
;; (format *trace-output* "~&.openmcl-init.lisp loaded~%")
;;----------------------------------------------------------------------
(in-package "COMMON-LISP-USER")
(use-package "COM.INFORMATIMAGO.PJB")
;;;; THE END ;;;;