Bug 1307169 - MAXIMA_USERDIR environment variable not respected by xmaxima
MAXIMA_USERDIR environment variable not respected by xmaxima
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: maxima (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Rex Dieter
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-12 16:52 EST by Steve
Modified: 2016-02-12 19:19 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-12 18:40:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steve 2016-02-12 16:52:58 EST
Description of problem:
According to the xmaxima manual page, the MAXIMA_USERDIR environment variable specifies the "directory  for  user  customization  files." However, when MAXIMA_USERDIR is set to a subdirectory of the home directory, the .xmaximarc file is still created in the home directory.

Version-Release number of selected component (if applicable):
maxima-gui-5.37.2-3.fc23.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. $ cd ~
2. $ mkdir ~/maxima-test
3. $ rm ~/.xmaximarc
4. $ MAXIMA_USERDIR=~/maxima-test xmaxima
5. Immediately exit xmaxima.
6. $ ls -a ~/.xmaximarc ~/maxima-test/.xmaximarc

Actual results:
.xmaximarc is created in the home directory.

Expected results:
.xmaximarc is created in the subdirectory ~/maxima-test.

Additional info:
The same problem occurs with the rmaxima command:
$ MAXIMA_USERDIR=~/maxima-test rmaxima

The command history is written to ~/.maxima_history, instead of ~/maxima-test/.maxima_history.

The MAXIMA_USERDIR environment variable in the xmaxima processes can verified this way:
$ ps e -C wish | fold -s | grep MAXIMA
$ ps e -C maxima | fold -s | grep MAXIMA
Comment 1 Rex Dieter 2016-02-12 17:01:06 EST
I can confirm xmaxima currently hard-codes use of ~/.xmaximarc

That said, the xmaxima man page makes it pretty clear that MAXIMA_USERDIR is for only 3 things:

CUSTOMIZATION FILES
       maximarc
              maximarc  is  sourced  by  the maxima script at startup. It should be located in $MAXIMA_USERDIR (see above). maximarc can be used, e.g., to change the user's
              default lisp implementation choice to CMUCL by including the line "MAXIMA_LISP=cmucl".

       maxima-init.lisp
              At startup, Maxima will load the lisp file maxima-init.lisp if it is found in the search path. For user customization, maxima-init.lisp should  be  placed  in
              the $MAXIMA_USERDIR (see above). Since Maxima typically has a system maxima-init.lisp in the Maxima share directory, the user may want to copy the contents of
              the system maxima-init.lisp into his/her custom file.  Alternatively, the user can load a Lisp initialization file with another name or location by  means  of
              the --init-lisp or --init command-line options.

       maxima-init.mac
              At  startup,  Maxima  will  load  the file maxima-init.mac if it is found in the search path.  For user customization, maxima-init.mac should be placed in the
              $MAXIMA_USERDIR (see above).  Alternatively, the user can load a Maxima initialization file with another name or location by means of the --init-mac or --init
Comment 2 Steve 2016-02-12 18:38:13 EST
(In reply to Rex Dieter from comment #1)
> I can confirm xmaxima currently hard-codes use of ~/.xmaximarc
...

Thanks for confirming that. The xmaxima man page doesn't actually mention .xmaximarc, but if it isn't a "CUSTOMIZATION" file, what is it?

The fundamental problem is that Maxima generates or reads a plethora of files, and they all clutter the home directory:
1. .xmaximarc
2. .maximarc
3. .maxima_history
4. Various plot files:
     maxout.gnuplot_pipes
     maxout.gnuplot
     ...

It would very convenient to set one environment variable that puts them all into a subdirectory.
Comment 3 Rex Dieter 2016-02-12 18:40:17 EST
like I  said in comment 1, the man page describes the 3 items it considers "CUSTOMIZATION FILES"

I'd recommend contacting upstream if you want any change here, since it is currently working as currently designed and documented (as far as I can tell)
Comment 4 Rex Dieter 2016-02-12 18:41:03 EST
https://sourceforge.net/p/maxima/_list/tickets
Comment 5 Steve 2016-02-12 18:55:27 EST
Status: 	CLOSED NOTABUG

Wow, Rex! Are you trying to help improve Maxima or to avoid work for which you volunteered? Blowing off legitimate bugs by referring them to Upstream is easy, but I am a *Fedora* user, not an "Upstream" user.
Comment 6 Rex Dieter 2016-02-12 19:05:29 EST
I'm a packager of upstream software.

I'm not generally in a position to implement new features (which is what I consider this to be).
Comment 7 Steve 2016-02-12 19:19:34 EST
(In reply to Rex Dieter from comment #6)
> I'm a packager of upstream software.
> 
> I'm not generally in a position to implement new features (which is what I
> consider this to be).

You certainly don't need to implement anything, but *interfacing with upstream* is part of the job for which you volunteered.

Note You need to log in before you can comment on or make changes to this bug.