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?


On  8.08.09, Lloyd Zusman wrote:
> 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.


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

> 1. Create a defaults.sl file in $JED_ROOT/lib 

Do this, if you are a packing jed for a linux distribution. 
If you are a system administrator, put the configuration file in /etc.
This way your self-made files are kept to /etc.

The Debian jed packages come with a default.sl that extend the startup
hook to read all files in /etc/jed.d/.

> and put the following lines into it:

> % 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

Use /usr/local/etc, if you installed jed from a tarball. If you got it
from a package /etc is a better choice.

Then, /etc/jed.conf can have the setup like Debian's
/etc/jed.d/05jed-common.sl::

  % Override (obsolete) code in site.sl that calls JED_ROOT/lib/jed.rc as
  % fallback configuration file
  Default_Jedrc_Startup_File = NULL;


-> JED_ROOT/lib/jed.rc, never gets loaded any more.


You can also load JED_ROOT/lib/jed.rc from /etc/jed.conf with

  () = evalfile("jed.rc");
  
and overwrite thing you want to change in subsequent lines.


For the reference I append the default jed config file of the Debian package
jed-common.

Günter

% debian 05jed-common.sl              -*- slang -*-

% make delete key delete the character under the cursor
% (section 10.8 of the Debian Policy)
#ifdef XWINDOWS
x_set_keysym (0xFFFF, 0, "\e[3~");
#endif
setkey ("delete_char_cmd", "\e[3~");

% Fallback emulation (if the user has no ~/.jedrc config file)
%
% Possible values are "brief", "cua", "emacs", "edt", "ide", "jed",
% "wordstar", and (with jed-extra) "vi".
%_Jed_Default_Emulation = "emacs";  % already set in site.sl

% Override (obsolete) code in site.sl that calls JED_ROOT/lib/jed.rc as
% fallback configuration file
Default_Jedrc_Startup_File = NULL;

% Jed_Home_Directory (defined in site.sl, defaulting to $HOME)
%
% If a subdir ~/.jed/ exists, point Jed_Home_Directory there,
% so .jedrc and .jedrecent are not spoiling the $HOME dir (FHS 2.3)
$1 = path_concat(Jed_Home_Directory, ".jed");
if ( 2 == file_status($1) ) {
   Jed_Home_Directory = $1;
   % set the default jedrc file path to ~/.jed/jed.rc
   $2 = path_concat(Jed_Home_Directory, "jed.rc");
   if (file_status($2) == 1)
     Default_Jedrc_Startup_File = $2;
}


% Add slsh documentation (site.sl misses this)
%
% You might add directories containing site-wide local help files to the array
foreach (["/usr/share/slsh/help",
          "/usr/share/slsh/local-packages/help"])
{
   $1 = ();
   if (file_status($1) != 2)
     continue;

   foreach (listdir($1))
     {
        $2 = ();
        if (path_extname($2) == ".hlp")
          % the doc path set with add_doc_file() is currently not
          % recognized by the standard help.sl
          % add_doc_file( path_concat($1, $2) );
          Jed_Doc_Files += "," + path_concat($1, $2);
     }
}

% do not call info_mode() for *.info files
% (as info_mode is no editing mode but an info reader mode!)
add_mode_for_extension("no", "info");

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