/usr/share/jed/lib/abbrmisc.sl is in jed-common 1:0.99.19-7.
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | % Miscellaneous function for the abbrev tables
require ("abbrev");
define define_abbrev_for_table (table, word)
{
variable n = what_line ();
variable use_bskip = 1;
variable exg = "exchange";
variable abbrev, expans;
if (markp ())
{
call (exg);
if (n == what_line (), call (exg)) use_bskip = 0;
}
push_spot ();
if (use_bskip)
{
push_mark ();
bskip_chars (word);
}
expans = bufsubstr ();
pop_spot ();
!if (strlen (expans))
{
expans = read_mini("For what?", Null_String, Null_String);
!if (strlen (expans)) return;
}
abbrev = read_mini ("Enter abbrev for '" + expans + "'", "", "");
!if (strlen (abbrev)) return;
define_abbrev (table, abbrev, expans);
}
define define_abbreviation ()
{
variable tbl, word;
(tbl, word) = what_abbrev_table ();
!if (strlen (tbl))
{
tbl = "Global";
create_abbrev_table (tbl, Null_String);
(tbl, word) = what_abbrev_table ();
}
define_abbrev_for_table (tbl, word);
}
private define quote_this_line ()
{
push_spot ();
while (ffind_char ('\\'))
{
insert_char ('\\');
go_right_1 ();
}
pop_spot ();
push_spot ();
while (ffind_char ('"'))
{
insert_char ('\\');
go_right_1 ();
}
pop_spot ();
}
define save_abbrevs ()
{
variable file = read_file_from_mini ("Save abbrevs to:");
variable n, table, word;
!if (strlen (extract_filename (file)))
{
file = dircat (file, Abbrev_File);
}
!if (strlen (extract_filename (file))) error ("Invalid file.");
n = list_abbrev_tables (); % tables on stack
!if (n) return;
() = read_file (file);
erase_buffer ();
loop (n)
{
table = ();
push_spot ();
word = dump_abbrev_table (table); % buffer now contain abbrevs
pop_spot ();
vinsert("create_abbrev_table (\"%s\", \"%s\");\n", table, word);
go_up_1 ();
while (down_1 () and not(eobp()))
{
insert ("define_abbrev (\""); insert(table);
insert ("\",\t\"");
quote_this_line ();
() = ffind_char ('\t');
trim ();
insert ("\",\t\"");
eol ();
insert ("\");");
}
}
save_buffer ();
delbuf (whatbuf);
}
|