/usr/share/jed/lib/krconv.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 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 | %enable_profiling ();
private define fixup_line ()
{
variable col;
!if (parse_to_point ())
{
col = what_column ();
bol_skip_white ();
if (col != what_column ())
{
goto_column (col);
indent_line ();
if (C_BRA_NEWLINE) newline ();
}
go_right_1 ();
trim ();
!if (eolp () or looking_at_char (',') or looking_at_char (';'))
{
indent_line ();
newline ();
}
}
go_right_1 ();
}
define c_indent_buffer ()
{
variable line = -50, max_line;
push_spot ();
eob ();
max_line = what_line ();
bob ();
do
{
bol_skip_white ();
if (looking_at ("/*"))
{
% skip the comment
() = fsearch ("*/");
continue;
}
eol ();
if (blooking_at ("\\"))
{
indent_line ();
% skip all continuation lines.
while (down (1))
{
eol ();
!if (blooking_at ("\\")) break;
}
continue;
}
trim ();
bol_skip_white ();
!if (looking_at_char ('{'))
{
variable this_line = what_line ();
% I do not want to touch constructs such as x = {1, 3};
while (ffind_char ('{')
and parse_to_point ())
go_right_1 ();
if (looking_at_char ('{'))
{
variable m = create_user_mark ();
if (find_matching_delimiter ('{')
and (this_line == what_line ()))
{
eol ();
indent_line ();
continue;
}
goto_user_mark (m);
}
bol ();
while (ffind_char ('}'))
fixup_line ();
bol ();
while (ffind_char ('{'))
fixup_line ();
}
indent_line ();
if (line + 50 < what_line ())
{
line = what_line ();
flush (sprintf ("processed %d/%d lines.", line, max_line));
}
%update_sans_update_hook (1);
}
while (down_1 ());
trim_buffer ();
flush (sprintf ("processed %d/%d lines.", what_line (), max_line));
pop_spot ();
}
|