I have added 3 command line options to allow the user to set the name of
the init files. I have also patched the maxima man page to reflect the
addition of these options, plus the recent addition of other options.
Let me note that it is very useful to have the flexibility to choose
between different start-up files. Myself, I have found that running
maxima in a terminal vs. another front-end often requires
changes or a different init file.
I hope these changes are acceptable.
Leo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
-------------- next part --------------
--- /home/work/maxima/tmp//maxima-5.19.2/doc/man/maxima.1.in 2009-06-02 06:33:05.000000000 +0100
+++ init-cl/maxima.1.in 2009-09-27 12:49:56.000000000 +0100
@@ -61,6 +61,15 @@
\fB\-h\fR, \fB\-\-help\fR
Display a brief usage summary.
.TP
+\fB\-\-init=\fR\fIstring\fR
+Set the name of the maxima and lisp init files to \fR\fIstring\fR.mac and \fR\fIstring\fR.lisp.
+.TP
+\fB\-\-initmac=\fR\fIfile\fR
+Set the name of the maxima init file to \fR\fIfile\fR.
+.TP
+\fB\-\-initlisp=\fR\fIfile\fR
+Set the name of the lisp init file to \fR\fIfile\fR.
+.TP
\fB\-l\fR \fIlisp\fR, \fB\-\-lisp=\fR\fIlisp\fR
Use Lisp implementation \fIlisp\fR. Use \fB\-\-list-avail\fR to see the
list of possible values.
@@ -85,6 +94,9 @@
Launch Maxima version \fIversion\fR. Use \fB\-\-list-avail\fR to see
the list of possible values.
.TP
+\fB\-\-userdir=\fR\fIdirectory\fR
+Use \fIdirectory\fR for user directory (default is $HOME/.maxima)
+.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print extra information from the Maxima wrapper script.
.TP
@@ -93,7 +105,9 @@
.TP
\fB\-\-very\-quiet\fR
Suppress expression labels and the Maxima start-up message.
-
+.TP
+\fB\-X\fR \fILisp options\fR, \fB\-\-lisp-options=\fR\fILisp options\fR
+Options to be given to the underlying Lisp.
.SH INTRODUCTORY INSTRUCTIONS
Upon initialization,
.I maxima
@@ -318,13 +332,17 @@
(see above). Since Maxima typically has a system
\fBmaxima-init.lisp\fR in the Maxima share directory, the user may
want to copy the contents of the system \fBmaxima-init.lisp\fR into
-his/her custom file.
+his/her custom file. The user can load a lisp init file with another
+name/location by means of the \fBinitlisp\fR or
+\fBinit\fR command-line options.
.TP
\fBmaxima-init.mac\fR
-At startup, Maxima will load the file \fBmaxima-init.mac\fR if
-it is found in the search path. For user customization,
+At startup, Maxima will load the file \fBmaxima-init.mac\fR if it is
+found in the search path. For user customization,
\fBmaxima-init.mac\fR should be placed in the \fB$MAXIMA_USERDIR\fR
-(see above).
+(see above). The user can load a lisp init file with another
+name/location by means of the \fBinitlisp\fR or \fBinit\fR
+command-line options.
.SH REFERENCES
Old Reference:
.I "MACSYMA Reference Manual"
-------------- next part --------------
--- maxima-5.19.2/src/init-cl.lisp 2009-08-02 21:20:58.000000000 +0100
+++ ../maxima-5.19.2/src/init-cl.lisp 2009-09-26 09:16:25.000000000 +0100
@@ -27,11 +27,14 @@
(defvar *maxima-htmldir*)
(defvar *maxima-layout-autotools*)
(defvar *maxima-userdir*)
+(defvar *maxima-initmac* "maxima-init.mac")
+(defvar *maxima-initlisp* "maxima-init.lisp")
(defvar *maxima-tempdir*)
(defvar *maxima-lang-subdir*)
(defvar *maxima-demodir*)
(defvar *maxima-objdir*) ;; Where to store object (fasl) files.
+
(eval-when (load compile eval)
(defmacro def-lisp-shadow (root-name)
"Create a maxima variable $root_name that is an alias for the lisp name *root-name*.
@@ -631,6 +634,22 @@
:argument "<directory>"
:action nil
:help-string "Use <directory> for user directory (default is $HOME/.maxima)")
+ (make-cl-option :names '("--init")
+ :argument "<file>"
+ :action #'(lambda (file)
+ (setf *maxima-initmac* (concatenate 'string file ".mac"))
+ (setf *maxima-initlisp* (concatenate 'string file ".lisp")))
+ :help-string (format nil "Set the name of the maxima/lisp init file to <file>.mac/<file>.lisp~%(default is ~a)" (substring *maxima-initmac* 0 (- (length *maxima-initmac*) 4)))
+ (make-cl-option :names '("--initmac")
+ :argument "<file>"
+ :action #'(lambda (file)
+ (setf *maxima-initmac* file))
+ :help-string (format nil "Set the name of the maxima init file (default is ~a)" *maxima-initmac*))
+ (make-cl-option :names '("--initlisp")
+ :argument "<file>"
+ :action #'(lambda (file)
+ (setf *maxima-initlisp* file))
+ :help-string (format nil "Set the name of the lisp init file (default is ~a)" *maxima-initlisp*))
(make-cl-option :names '("-l" "--lisp")
:argument "<lisp>"
:action nil