summaryrefslogtreecommitdiff
path: root/systems/unix/tex-fpc/mf.ch
diff options
context:
space:
mode:
Diffstat (limited to 'systems/unix/tex-fpc/mf.ch')
-rw-r--r--systems/unix/tex-fpc/mf.ch121
1 files changed, 52 insertions, 69 deletions
diff --git a/systems/unix/tex-fpc/mf.ch b/systems/unix/tex-fpc/mf.ch
index 0b697ec3da..1a5a2eab18 100644
--- a/systems/unix/tex-fpc/mf.ch
+++ b/systems/unix/tex-fpc/mf.ch
@@ -13,8 +13,8 @@
\N0\*. \[0] About \namefpc.
-This is an adaption of Donald~E. Knuth's \MF, version 2.7182815
-from January 2014, to Free~Pascal (FPC) and Unix.
+This is an adaption of Donald~E. Knuth's \MF, version 2.71828182
+from January 2021, to Free~Pascal (FPC) and Unix.
The features added include treating the command line as the first
input line and invoking a system editor, in this case \.{vi}, to
@@ -36,9 +36,9 @@ Comments and questions are welcome!
[2] Change the banner line
@x
-@d banner=='This is METAFONT, Version 2.7182818' {printed when \MF\ starts}
+@d banner=='This is METAFONT, Version 2.71828182' {printed when \MF\ starts}
@y
-@d banner=='This is METAFONT-FPC, 2nd ed.' {printed when \MF\ starts}
+@d banner=='This is METAFONT-FPC, 3rd ed.' {printed when \MF\ starts}
@z
[4] terminal output and input
@@ -85,15 +85,15 @@ cursor to the @x line and enter >} or <} to (un)indent a paragraph.
@z
[7] shift left to turn on statistics, shift rigth to turn off statistics
- @x stat
- @d stat==@{ {change this to `$\\{stat}\equiv\null$' when gathering
- usage statistics}
- @d tats==@t@>@} {change this to `$\\{tats}\equiv\null$' when gathering
- usage statistics}
- @y
- @d stat== {change this to `$\\{stat}\equiv\.{@@\{}$' to turn off statistics}
- @d tats== {change this to `$\\{tats}\equiv\.{@@\}}$' to turn off statistics}
- @z
+@x stat
+@d stat==@{ {change this to `$\\{stat}\equiv\null$' when gathering
+ usage statistics}
+@d tats==@t@>@} {change this to `$\\{tats}\equiv\null$' when gathering
+ usage statistics}
+@y
+@d stat== {change this to `$\\{stat}\equiv\.{@@\{}$' to turn off statistics}
+@d tats== {change this to `$\\{tats}\equiv\.{@@\}}$' to turn off statistics}
+@z
[8] shift left to build MF and right it to build INIMF.
@x inimf
@@ -417,9 +417,17 @@ loop@+begin wake_up_terminal; write(term_out,'**'); update_terminal;
@x
else bad_pool('! I can''t read MF.POOL.')
@y
-else bad_pool('! I can''t read mf.pool.')
+else bad_pool('! I can''t read MFbases/mf.pool.')
+@z
+
+[53] tangle would'nt help, installation would
+@x
+done: if a<>@$ then bad_pool('! MF.POOL doesn''t match; TANGLE me again.');
+@y
+done: if a<>@$ then bad_pool('! MFbases/mf.pool doesn''t match. Not installed?');
@z
+
[74] start editor
@x
@!use_err_help:boolean; {should the |err_help| string be shown?}
@@ -438,14 +446,9 @@ start_edit := false; { don't start \.{vi}}
[79] set edit_cmd
@x
- begin print_nl("You want to edit file ");
-@.You want to edit file x@>
- slow_print(input_stack[file_ptr].name_field);
- print(" at line "); print_int(line);@/
interaction:=scroll_mode; jump_out;
end;
@y
- begin {save values to be passed to the system editor}
start_edit := true;
interaction:=scroll_mode; jump_out;
end;
@@ -471,10 +474,12 @@ if c="Q" then decr(selector); return;
[194] date and time
@x
@p procedure fix_date_and_time;
-begin internal[time]:=12*60*unity; {minutes since midnight}
-internal[day]:=4*unity; {fourth day of the month}
-internal[month]:=7*unity; {seventh month of the year}
-internal[year]:=1776*unity; {Anno Domini}
+begin sys_time:=12*60;
+sys_day:=4; sys_month:=7; sys_year:=1776; {self-evident truths}
+internal[time]:=sys_time*unity; {minutes since midnight}
+internal[day]:=sys_day*unity; {day of the month}
+internal[month]:=sys_month*unity; {month of the year}
+internal[year]:=sys_year*unity; {Anno Domini}
end;
@y
@p procedure fix_date_and_time;
@@ -482,11 +487,15 @@ var yy,mm,dd: word;
hh,ss,ms: word;
begin
decodedate(now,yy,mm,dd); {current date}
-internal[day] := dd*unity;
-internal[month] := mm*unity;
-internal[year] := yy*unity;@/
+sys_day := dd;
+sys_month := mm;
+sys_year := yy;
+internal[day] := sys_day*unity;
+internal[month] := sys_month*unity;
+internal[year] := sys_year*unity;@/
decodetime(now,hh,mm,ss,ms); {current time}
-internal[time] := (hh*60+mm)*unity; {minutes since midnight}
+sys_time := hh*60+mm; {minutes since midnight}
+internal[time] := sys_time*unity; {minutes since midnight}
end;
@z
@@ -535,15 +544,15 @@ int(4096))|, and |abs(int(a+b-4096))| will throw an overflow exception.
@z
[679] spurious empty line on terminal
- @x chatty
- print_ln; first:=start;
- prompt_input("*"); {input on-line into |buffer|}
- @y
- @.Please type...@>
- print_nl("");
- first:=start; {avoid empty lines on terminal and log file}
- prompt_input("*"); {input on-line into |buffer|}
- @z
+@x chatty
+ print_ln; first:=start;
+ prompt_input("*"); {input on-line into |buffer|}
+@y
+@.Please type...@>
+ print_nl("");
+ first:=start; {avoid empty lines on terminal and log file}
+ prompt_input("*"); {input on-line into |buffer|}
+@z
[769] Path separator in Unix
@x
@@ -561,27 +570,9 @@ else begin if c="/" then
[774]
@x
-@d append_to_name(#)==begin c:=#; incr(k);
-@y
-@d fpc_set_length==s@&e@&t@&l@&e@&n@&g@&t@&h
-@d append_to_name(#)==begin c:=#; incr(k);
-@z
-
-[774]
-@x
-@!j:pool_pointer; {index into |str_pool|}
-@y
-@!j:pool_pointer; {index into |str_pool|}
-rbs: fpc_string;
-@z
-
-[774]
-@x
for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
@y
-rbs := name_of_file;
-fpc_set_length(rbs, name_length);
-name_of_file := rbs;
+for k:=name_length+1 to file_name_size do name_of_file[k]:=chr(0);
@z
[776]
@@ -593,19 +584,16 @@ MF_base_default:='MFbases/plain.base';
[778]
@x
-@!j:integer; {index into |buffer| or |MF_base_default|}
+for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
@y
-@!j:integer; {index into |buffer| or |MF_base_default|}
-rbs: fpc_string;
+for k:=name_length+1 to file_name_size do name_of_file[k]:=chr(0);
@z
-[778]
+[779] report the file you can't read
@x
-for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
+ wterm_ln('I can''t find the PLAIN base file!');
@y
-rbs := name_of_file;
-fpc_set_length(rbs, name_length);
-name_of_file := rbs;
+ wterm_ln('I can''t find MFbases/plain.base!');
@z
[786]
@@ -617,7 +605,7 @@ print_nl("Please type another "); print(s); print(" or Control-D");
[793] name might be needed to be passed to vi
@x
-if name=str_ptr-1 then {we can conserve string pool space now}
+if name=str_ptr-1 then {conserve string pool space (but see note above)}
begin flush_string(name); name:=cur_name;
end;
@y
@@ -766,11 +754,6 @@ begin
line_arg := chr(0);
iv
@#
- ed
- selector := term_only;
- write('You want to edit at line '); print(s); print_ln;
- de
- @#
selector := sel;
j := str_start[edit_file];
l := length(edit_file);