[NTG-pdftex] 1.40.4 incoming

Akira Kakuto kakuto at fsci.fuk.kindai.ac.jp
Tue Jul 10 16:21:08 CEST 2007


> 2007/7/10, Taco Hoekwater <taco at elvenkind.com>:
> > I vote for Phil's approach. I suspect most of the people that do
> > not know how to generate an EOF in the console will not understand
> > the key press reference either.
> >
> > Besides, tricks like dummy strings tend to lead to bugs in the years
> > to come. (said as the person who just spend a whole day figuring out
> > that the weird "file_name_size=maxint" statement in tex.ch is part
> > of a trick to simplify openclose.c as it forces the "namelength" var
> > to be of the correct allocation size).
> 
> Agreed. KISS :-)

luaTeX does not use tex.ch. For Taco's convenience,
I've tried to make a patch:

Best regards,
Akira


--- luatex.ch.orig	Mon Jul 09 20:34:16 2007
+++ luatex.ch	Tue Jul 10 23:13:12 2007
@@ -1404,12 +1404,20 @@
 @y
 var k:0..buf_size; {index into |buffer|}
 @!saved_cur_name:str_number; {to catch empty terminal input}
+@!saved_cur_ext:str_number; {to catch empty terminal input}
+@!saved_cur_area:str_number; {to catch empty terminal input}
 @z
 
 @x
 if e=".tex" then show_context;
 @y
 if (e=".tex") or (e="") then show_context;
+print_ln; print("(Enter the null string to re-try, or <eof> to exit");
+if (e<>"") then
+  begin
+    print(" Default file extension is `"); print(e); print("'");
+  end;
+print(")"); print_ln;
 @z
 
 @x
@@ -1417,9 +1425,17 @@
 if cur_ext="" then cur_ext:=e;
 @y
 saved_cur_name:=cur_name;
+saved_cur_ext:=cur_ext;
+saved_cur_area:=cur_area;
 clear_terminal; prompt_input(": "); @<Scan file name in the buffer@>;
-if cur_ext="" then cur_ext:=e;
-if length(cur_name)=0 then cur_name:=saved_cur_name;
+if (length(cur_name)=0) and (cur_ext="") and (cur_area="") then
+  begin
+    cur_name:=saved_cur_name;
+    cur_ext:=saved_cur_ext;
+    cur_area:=saved_cur_area;
+  end
+else
+  if cur_ext="" then cur_ext:=e;
 @z
 
 @x


More information about the ntg-pdftex mailing list