Startup and default directory

9 views
Skip to first unread message

Blake McBride

unread,
Dec 9, 2020, 8:22:37 AM12/9/20
to Interlisp core, Larry Masinter, Nick Briggs, Ron Kaplan, Arun Welch, Herb Jellinek
Greetings,

Regardless of the directory I am in when I start Medley, it appears to switch to my home directory.

- the top of the display shows:  Dir <*> on {DSK}
- lisp.virtualmem gets created in my home directory
- my SYSOUT files get created in my home directory
- (CLEANUP) files end up in my home directory
- (CHDIR) shows "{DSK}<home>blake>"  (my home directory)
- etc.

This is a problem for a few reasons:

1.  It clutters up my home directory.

2.  I often work on several different and unrelated projects at the same time.  I'd prefer for the lisp.virtualmem, my SYSOUT files, and my makefiles to be in the same directory that is associated with the particular project I am working on.  This way I can have different sets of files for different projects I am working on.

It occurs to me that Medley might have a simple way of dealing with this.  I just don't know how to change this.

Thanks!

Blake McBride

Larry Masinter

unread,
Dec 9, 2020, 12:45:52 PM12/9/20
to Blake McBride, Interlisp core, Nick Briggs, Ron Kaplan, Arun Welch, Herb Jellinek
There is probably a GitHub issue on this. But where should lisp.virtualmem be saved?
And Ron wanted to add in AUTOSAMEDIR so that cleanup() files would ordinarily go into the same directory....
These things should go into your personal INIT?


--
You received this message because you are subscribed to the Google Groups "Medley Interlisp core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispcore+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lispcore/CABwHSOsUb-1YAW8S7DJXE7w3j4pxP5B-sOinSTFkLOmE%2BM9pQA%40mail.gmail.com.


--

Ron Kaplan

unread,
Dec 9, 2020, 1:01:08 PM12/9/20
to Larry Masinter, Blake McBride, Interlisp core, Nick Briggs, Arun Welch, Herb Jellinek
Not AUTOSAMEDIR.  I would get rid of that, the functionality is now in SAMEDIR.  SAMEDIR defaults after a timeout to “oops”, which is now set up to switch to the file’s original directory, and then switch back after the file is made/compiled.  AUTOSAMEDIR is not needed.

Nick Briggs

unread,
Dec 9, 2020, 1:12:30 PM12/9/20
to Blake McBride, Interlisp core, Ron Kaplan, Arun Welch, Herb Jellinek, Larry Masinter
The C code looks for $HOME/lisp.virtualmem on startup if you're running under X (or ~/lisp.virtualmem if you're using a raw display device (!)) if there is: no explicit sysout name given on the command line, or LDESRCESYSOUT or LDESOURCESYSOUT environment variable in order, note spelling difference).

For saving an image, the C code says:

/************************************************************************/
/*                                                                      */
/*                      v m e m _ s a v e 0                             */
/*                                                                      */
/*      Implements the VMEMSAVE subr.  Write out the current lisp       */
/*      lisp image to the specified file.  If the sysout file-name      */
/*      is explicitly specified, the directory on which the file        */
/*      resides is exactly (?) an existing directory.  This is          */
/*      guaranteed by the Lisp code, \MAIKO.CHECKFREEPAGE in LLFAULT.   */
/*                                                                      */
/*      If the file argument is nill, the default sysout-file name,     */
/*      "~/lisp.virtualmem", is used, subject to override by the        */
/*      LDEDESTSYSOUT UNIX-environment variable.                        */
/*                                                                      */

I haven't tracked down where it decides that {DSK} is exactly your login home directory -- I do know that it's not based on $HOME because changing HOME doesn't affect it.

-- Nick

Ron Kaplan

unread,
Dec 9, 2020, 1:14:20 PM12/9/20
to Blake McBride, Interlisp core, Larry Masinter, Nick Briggs, Arun Welch, Herb Jellinek
There is an environment variable LOGINDIR that tells medley where you want internal (CNDIR) or cd to go by default and where medley thinks you are initially connected to (which is distinct from your shell connected directory at the time your start up medley).  By that also says where your personal greeting file is (and your personal greeting file could then redefine that variable for later cd/CNDIR defaulting).  I presume that Larry’s runmedley defaults that variable if it isn’t already defined in the environment.

So, that’s how it knows where your personal greeting file is, and what cd with no arguments goes to.  I think all the other file operations go to the (medley-internal, not the shell) connected directory (e.g. after cd foo or (CNDIR ‘foo), (SYSOUT ‘X.SYSOUT) will go to foo/X.sysout)).

I have never used CHDIR, didn’t know it existed.  Seems to be changing the connected directory in a shell, but I’m not sure which shell it is or why one would want to do that.  Can someone explain?

The location of the lisp.virtualmen is determined separately, defaults to my Mac home directory (/Users/kaplan).

Ron Kaplan

unread,
Dec 9, 2020, 1:19:34 PM12/9/20
to Blake McBride, Interlisp core, Larry Masinter, Nick Briggs, Arun Welch, Herb Jellinek
BTW, the environment variable LOGINDIR is used to construct the medley variable LOGINHOST/DIR, which is actually what all the other medley functions reference.  Problem was that the slash was not obviously allowed in the name of a shell variable.

Larry Masinter

unread,
Dec 9, 2020, 1:47:36 PM12/9/20
to Ron Kaplan, Blake McBride, Interlisp core, Nick Briggs, Arun Welch, Herb Jellinek
Just in time, GitHub has added a feature called "Community Discussions".

I added the default boilerplate. There is currently an Issue fixing up INIT and loadup files · Issue #75 · Interlisp/medley (github.com)
which I can convert to a Discussion (until we know enough to figure out what we want in a way that everyone is happy.)

Nick Briggs

unread,
Dec 9, 2020, 1:50:27 PM12/9/20
to Ron Kaplan, Blake McBride, Interlisp core, Larry Masinter, Arun Welch, Herb Jellinek
Underneath the Lisp stuff (which I haven't looked at in detail yet), there's the whole maze of twisty little passages in {dsk} vs {unix}.

At the lisp level there's the lispusers/CD package, which is how Henry Thompson thought things should work between 1982-88, and VANILLA-INIT and GENERIC-INIT which also adjust things to how Stan Lanning thought it should work when he was mostly using it as a common lisp environment.

-- Nick

On Dec 9, 2020, at 10:14 AM, Ron Kaplan <ron.k...@post.harvard.edu> wrote:

Reply all
Reply to author
Forward
0 new messages