1:- module(local_config, []).    2
    3:- 	prolog_load_context(directory, Dir),
    4	setenv(prolog_load_context, Dir).
    7user:pac_http_prefix('http://localhost').			  % for macOS
    8%  user:pac_http_prefix('http://web.sfc.keio.ac.jp').  % webedit.
    9
   10:- expand_file_name('~/Desktop/snapshot', [S|_]),
   11	setenv(snapshot, S).   12
   13%
   14user:pac_directories(
   15		[	(pac_root : []) -
   16			 [	test:test,
   17				:(prolog) -
   18					[	pac		: pac,
   19						misc	: misc,
   20						zdd		: misc,
   21						tmp		: tmp,
   22						gb		: "misc/grobner",
   23						other	: other
   24					]]]
   25			   ).
   26%
   27user:pac_exec([	"~/local/cgi-bin/",
   28			"~/local/bin/",
   29			"/usr/local/bin/",
   30			"/Library/TeX/texbin/",
   31			"/bin/",
   32			"/usr/bin/"
   33		  ]).
   34
   35%
   36user:mk_pac_cgi([				% referred to by cgi.
   37			home(H),
   38			user(U),
   39			cgi_bin(Cgi),
   40			http_cgi_bin(Hcgi),
   41			public_html(Pub),
   42			http_public_html(Hpub),
   43			snapshot(Snap)
   44		  ])	:-
   45	getenv(prolog_load_context, Dir),
   46	split_string(Dir, /, '', [A, B, U0|_]),
   47	atom_string(U, U0),
   48	concat_atom([A, B, U], /, H),
   49	pac_http_prefix(Hprefix),
   50	concat_atom([H, '/public_html'], Pub),
   51	concat_atom([Hprefix, '/~', U], Hpub),
   52	concat_atom([H, '/public_html/cgi-bin'], Cgi),
   53	concat_atom([Hprefix, '/~', U, '/cgi-bin'], Hcgi),
   54	concat_atom([H, '/Desktop/snapshot'], Snap),
   55% setenv.
   56	setenv(home, H),
   57	setenv(user, U),
   58	setenv(cgi_bin, Cgi),
   59	setenv(http_cgi_bin, Hcgi),
   60	setenv(public_html, Pub),
   61	setenv(http_public_html, Hpub),
   62	setenv(snapshot, Snap)