how to re-define the HOME directory?



On Mon, Jun 01, 2009 at 01:22:54PM -0500, James Amundson wrote:
> On 06/01/2009 10:07 AM, Oliver Kullmann wrote:
> >Hi,
> >
> >since in my research platform Maxima needs to run locally,
> >without intrusion of the user space, I needed to do something
> >w.r.t. the .maxima directory, and fortunately redefining the
> >environment variable HOME when calling Maxima does the job!
> >   
> Maybe, but that's not the right way to do it. You want to set 
> MAXIMA_USERDIR to point to your .maxima directory. The maxima man page 
> describes the Maxima environment variables and configuration files and 
> directories. Here's what it says about MAXIMA_USERDIR:
> 
> MAXIMA_USERDIR
> Points to a directory for user customization files. Maxima?s default 
> search paths include MAX-
> IMA_USERDIR. Default value: $HOME/.maximaq
>

Unfortunately this doesn't say so much, and actually it is useless (perhaps
this is a bug):

What I want is that the creation of the directory .maxima and the file
.maxima_history happens where *I* want them to be.
Now maxima_history can't be influenced at all, and thus HOME has to be used here.
And also maxima_userdir is useless, since for that initial compilation of
the graph-library files like 


;;; Note: Invoking external command:
;;;   /home/csoliver/SAT-Algorithmen/OKplatform/ExternalSources/Installations/Gcc/4.1.2/bin/gcc  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -I/home/csoliver/SAT-Algorithmen/OKplatform/ExternalSources/Installations/Gmp/4.1.2/4.3.1/include -Dlinux -O "-I/home/csoliver/SAT-Algorithmen/OKplatform/ExternalSources/Installations/Ecl/9.4.1/include/" -w -c "/home/csoliver/.maxima/binary/binary-ecl/share/contrib/graphs/dijkstra.c" -o "/home/csoliver/.maxima/binary/binary-ecl/share/contrib/graphs/dijkstra.o"


maxima_userdir is apparently *not* used (the above shows part of the compilation instructions
issued when starting Maxima, and one can see that it places them in my home directory, although
maxima_userdir has a different value). It seems the problem here is that this happens *before* the initialisation
file is read, and only there you can place the definition of maxima_userdir.
Perhaps this should be submitted as a bug report.

> I would expect redefining HOME to have other, unintended consequences 
> like...
> >Alas, now I found out that gnuplot (version 4.2.4 or 4.2.5,
> >but apparently this doesn't matter) doesn't work anymore:
> >
> >(%i1) plot2d(sin(x),[x,-5,5])$
> >Xlib: connection to ":0.0" refused by server
> >Xlib: No protocol specified
> >gnuplot: unable to open display ':0'
> >gnuplot: X11 aborted.
> >   
> 
> ...that.
>

I have a fairly extensive test system, and besides the above problem there appears to be none.
And now by placing a symlink in that directory to ~/.Xauthority also this problem is solved!

Thanks for your comments!

Oliver

P.S. Regarding customisation, cluttering of the user-space by files like .maxima and .maxima_history
isn't the biggest problem (so well, one could live with that), but the real problem is that there
is no control where to place the initialisation file! What would be needed is a straight-forward
"forget all your default paths etc., but find the initialisation file exactly here".
 
> --Jim Amundson
> (who set
> up all this sort of thing in the first place, and is glad to see that he 
> anticipated the sort of customization you need.)
> 

-- 
Dr. Oliver Kullmann
Computer Science Department
Swansea University
Faraday Building, Singleton Park
Swansea SA2 8PP, UK
http://cs.swan.ac.uk/~csoliver/