/usr/share/jed/lib/chglog.sl is in jed-common 1:0.99.19-3.
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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | % Maintain ChangeLog files
custom_variable ("ChangeLog_Filename",
#ifdef VMS
"$CHANGE_LOG$.TXT"
#else
"ChangeLog"
#endif
);
custom_variable ("ChangeLog_User",
sprintf ("%s <%s>", get_realname (), get_emailaddress ()));
custom_variable ("ChangeLog_Indent_Amount", 8);
private define get_changelog_date ()
{
variable tm, day, month, year;
tm = localtime (_time ());
sprintf ("%d-%0d-%0d", 1900 + tm.tm_year, 1+tm.tm_mon, tm.tm_mday);
}
private define format_changelog_heading ()
{
variable date = get_changelog_date ();
return sprintf ("%s %s", date, ChangeLog_User);
}
private define locate_changelog_file ()
{
variable file, dir;
(,dir,,) = getbuf_info ();
forever
{
file = dircat (dir, ChangeLog_Filename);
if (1 == file_status (file))
return file;
% This may need modified for non-Unix systems...
#ifdef UNIX
dir = expand_filename (dircat (dir, "../"));
if (dir == "/")
break;
#elifdef IBMPC_SYSTEM
dir = expand_filename (dircat (dir, "..\\"));
if ((dir == "/") or (dir == "\\"))
break;
if (strlen (dir) == 3)
{
if (dir[1] == ':')
break;
}
#elifdef VMS
% Does this work?
dir = expand_filename (dircat (dir, "[-]"));
#endif
}
verror ("Unable to find a ChangeLog file");
}
private define get_changelog_file_item ()
{
variable dir, file;
(file, dir,,) = getbuf_info ();
!if (strlen (file))
return "";
if (file == ChangeLog_Filename)
return "";
return dircat (dir, file);
}
private define get_changelog_function ()
{
variable fun = mode_get_mode_info ("chglog_get_item");
if (fun != NULL)
fun = @fun ();
if (fun == NULL)
return "";
return fun;
}
private define wrap_hook ()
{
push_spot ();
bol_trim (); whitespace (ChangeLog_Indent_Amount + 2);
pop_spot ();
}
public define changelog_add_change ()
{
variable heading = format_changelog_heading ();
variable file = get_changelog_file_item ();
variable function = get_changelog_function ();
variable changelog = locate_changelog_file ();
if (strlen (file))
{
% Make it with respect to the changelog directory
variable i = 0;
while (changelog[i] == file[i]) % can this fail in practice?
i++;
file = file [[i:]];
}
() = read_file (changelog);
set_buffer_no_backup ();
pop2buf (whatbuf ());
text_mode ();
set_buffer_hook ("wrap_hook", &wrap_hook);
bob ();
!if (bol_fsearch (heading))
{
vinsert ("%s\n\n", heading);
bob ();
}
eol ();
variable m = create_user_mark ();
skip_chars (" \t\n*");
variable create_new_entry = 1;
if (looking_at (file))
{
go_right (strlen (file));
_get_point (); % on stack
skip_chars (" :");
create_new_entry = (() == _get_point ());
}
if (create_new_entry)
{
goto_user_mark (m);
insert ("\n\n");
whitespace (ChangeLog_Indent_Amount);
vinsert ("* %s ", file);
}
else
{
!if (re_fsearch ("^[ \t]*$"))
{
eob ();
}
trim ();
newline ();
go_up_1 ();
whitespace (8);
}
if (strlen (function))
vinsert ("(%s): ", function);
else if (create_new_entry and strlen (file))
{
trim ();
insert (": ");
}
}
|