/usr/share/jed/lib/modeinfo.sl is in jed-common 1:0.99.19-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | % These routines facilitate the manipulation of mode dependent data.
private variable Mode_Info_Type = struct
{
fold_info, % folding.sl: beg\rend\r\beg1\r\end1
dabbrev_word_chars, % word chars for dabbrev mode
init_mode_menu,
chglog_get_item,
use_dfa_syntax,
};
private variable Mode_Info_List = Assoc_Type [Struct_Type];
private define find_mode_info (mode_name)
{
!if (assoc_key_exists (Mode_Info_List, mode_name))
return NULL;
return Mode_Info_List[mode_name];
}
define mode_set_mode_info (field_name, field_value)
{
variable mode_info;
variable mode_name = get_mode_name ();
if (_NARGS == 3)
mode_name = ();
mode_info = find_mode_info (mode_name);
if (mode_info == NULL)
{
mode_info = @Mode_Info_Type;
Mode_Info_List [mode_name] = mode_info;
}
variable fields = get_struct_field_names (mode_info);
!if (any (fields == field_name))
{
variable new_mode_info = @Struct_Type ([fields, field_name]);
foreach (fields)
{
variable f = ();
set_struct_field (new_mode_info, f, get_struct_field (mode_info, f));
}
mode_info = new_mode_info;
Mode_Info_List [mode_name] = mode_info;
}
set_struct_field (mode_info, field_name, field_value);
}
define mode_get_mode_info (field_name)
{
variable mode_info;
if (_NARGS == 1)
get_mode_name ();
variable mode_name = ();
mode_info = find_mode_info (mode_name);
if (mode_info == NULL)
return NULL;
!if (any (field_name == get_struct_field_names (mode_info)))
return NULL;
return get_struct_field (mode_info, field_name);
}
|