jed-users mailing list

[2009 Date Index] [2009 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: System-wide jed.rc that does not get overwritten when jed is upgraded?


Lloyd Zusman <ljz <at> asfast.com> writes:

> 
> Lloyd Zusman <ljz <at> asfast.com> writes:
> 
> > 
> > Lloyd Zusman <ljz <at> asfast.com> writes:
> > 
> > > [ ... ]
> > >
> > [ ... ]
> > 
> [ ... ]
> 
> Well, neither of these options would be the end of the world, but I think
> it would be better if the standard installation of jed would allow something
> like /etc/jed.conf to _override_ $JED_ROOT/lib/jed.rc settings, instead of
> the opposite.

This is my last reply to my own message. It's been fun debating with
myself!

Anyway, I just now figured out a very easy solution to my problem:

1. Create a defaults.sl file in $JED_ROOT/lib and put the following
lines into it:

% -*- mode: slang; mode: fold; -*-

% Use a system-wide alternative to $JED_ROOT/lib/jed.rc
Default_Jedrc_Startup_File = "/usr/local/etc/jed.conf";

2. Copy $JED_ROOT/lib/jed.rc to /usr/local/etc/jed.conf

3. Edit /usr/local/etc/jed.conf to your liking.

Because this redefines Default_Jedrc_Startup_File, the standard
command_line_hook() function will load /usr/local/etc/jed.conf
instead of $JED_ROOT/lib/jed.rc. This allows the definitions in
/usr/local/etc/jed.conf to remain in effect and not be overridden
by those in $JED_ROOT/lib/jed.rc, which never gets loaded any more.

And since defaults.sl and /usr/local/etc/jed.conf don't get
overwritten during "make install", we can be assured that these
system-wide changes will remain in effect even when jed is upgraded.

Another way to do this is to set up defaults.sl as described above,
but to make /usr/local/etc/jed.conf do something like this (untested):

variable default_init_file = strcat(getenv("JED_ROOT"), "/lib/jed.rc");
if (1 == file_status(default_init_file))
{
  variable depth = _stkdepth ();
  () = evalfile (default_init_file);
  depth = _stkdepth () - depth;
}
%% Now, change any settings from jed.rc that you don't like.

The advantage of this alternative is that /usr/local/etc/jed.conf
doesn't have a lot of copied code in it; only the overrides that
are specified. This protects us against the case where a future
version of jed makes use of a signficantly altered
$JED_ROOT/lib/jed.rc file.

OK. That's it. Thanks for your patience with my inner dialog. :)

-- 
 Lloyd Zusman
 ljz@xxxxxxxxxx
 God bless you.



--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2009 date index] [2009 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]