[tex-live] source changes

Olaf Weber olaf@infovore.xs4all.nl
01 Jun 2002 16:48:58 +0200


Olaf Weber writes:
> Olaf Weber writes:
>> Sebastian Rahtz writes:

>>> My proposal for TeX Live 7:
>>> * anything with src specials will identify itself as euTeX in the banner
>>> * Fabrice will commit source changes today
>>> * we aim to get a recompile of tex, etex, and pdftex by Sunday 2300 GMT
>>> * the update to also include dvips 5.90
>>> * I will owe all compilers a large bunch of flowers

>>> well, not so much of a proposal as a statement :-}

>> I may have a fix for the \special issue that avoids the problems that
>> arise with redefining \special.

> I'm at the point where redefining \special doesn't affect source
> specials.

> The second problem is that source specials can be "captured" into
> arguments and such, because they're (mostly, but not exclusively)
> ordinary specials inserted into the token stream.  It seems the
> "\everypar" example can be made to work by postponing the creation of
> the source special for that paragraph until after the everypar
> processing has been done.

> Would this be good enough for now?

For what it's worth, here are the changes I came up with, and with
which I'm currently most comfortable: no change in the first banner
line (sorry), an additional banner line if source specials are
enabled, and some trickery to prevent redefinition and the known case
of accidental capture (\everypar).

This changes 3 files:

Index: tex.ch
===================================================================
RCS file: /usr/local/cvsroot/texk/texk/web2c/tex.ch,v
retrieving revision 1.43
diff -u -r1.43 tex.ch
--- tex.ch      17 Dec 2001 20:02:24 -0000      1.43
+++ tex.ch      1 Jun 2002 14:37:51 -0000
@@ -535,8 +535,7 @@
 @!dvi_buf_size:integer; {size of the output buffer; must be a multiple of 8}
 @!file_line_error_style_p:boolean; {format error messages as file:line:error}
 {Variables for source specials}
-@!special_loc:pointer;
-@!special_token:halfword;
+@!src_specials_p : boolean;{Whether src_specials are enabled at all}
 @!insert_src_special_auto : boolean;
 @!insert_src_special_every_par : boolean;
 @!insert_src_special_every_parend : boolean;
@@ -865,6 +864,9 @@
 wterm(version_string);
 if format_ident>0 then slow_print(format_ident);
 print_ln;
+if src_specials_p then begin
+  wterm_ln('Source specials enabled.')
+end;
 if translate_filename then begin
   wterm('(');
   fputs(translate_filename, stdout);
@@ -1200,6 +1202,16 @@
 substitution definitions.
 @z
 
+@x [17.222] l.4523 - frozen_special, for source specials.
+@d frozen_null_font=frozen_control_sequence+10
+  {permanent `\.{\\nullfont}'}
+@y
+@d frozen_special=frozen_control_sequence+10
+  {permanent `\.{\\special}'}
+@d frozen_null_font=frozen_control_sequence+11
+  {permanent `\.{\\nullfont}'}
+@z
+
 @x [17.222] l.4526 - max_font_max
 @d undefined_control_sequence=frozen_null_font+257 {dummy location}
 @y
@@ -1737,9 +1749,15 @@
 months := ' JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';
 @z
 
-@x [29/536] l.10331 - Print TCX name if one's given.
+% Print whether we're using src-specials.
+% Print TCX name if one's given.
+@x [29/536] l.10331
 end
 @y
+if src_specials_p then begin
+  wlog_cr;
+  wlog('Source specials enabled.')
+end;
 if translate_filename then begin
   wlog_cr;
   wlog('(');
@@ -2892,14 +2910,10 @@
  @z
 
 @x [47.1091] l.21064 - source specials
-if indented then
-  begin tail:=new_null_box; link(head):=tail; width(tail):=par_indent;@+
-  end;
+if every_par<>null then begin_token_list(every_par,every_par_text);
 @y
-if indented then
-  begin tail:=new_null_box; link(head):=tail; width(tail):=par_indent;
-  if (insert_src_special_every_par) then insert_src_special;@+
-  end;
+if every_par<>null then begin_token_list(every_par,every_par_text);
+if (insert_src_special_every_par) then insert_src_special;
 @z
 
 % disabled in original tex-src-special.ch, conflicts with etex.
@@ -3279,12 +3293,6 @@
 undump_things (mem[hi_mem_min], mem_end+1-hi_mem_min);
 @z
 
-@x [50.1313] l.23896 - source specials
-dump_int(par_loc); dump_int(write_loc);@/
-@y
-dump_int(par_loc); dump_int(write_loc); dump_int(special_loc);@/
-@z
-
 @x [50.1314] l.23899 - hash_extra, source specials
 undump(hash_base)(frozen_control_sequence)(par_loc);
 par_token:=cs_token_flag+par_loc;@/
@@ -3293,8 +3301,6 @@
 undump(hash_base)(hash_top)(par_loc);
 par_token:=cs_token_flag+par_loc;@/
 undump(hash_base)(hash_top)(write_loc);@/
-undump(hash_base)(hash_top)(special_loc);
-special_token:=cs_token_flag+special_loc;@/
 @z
 
 @x [50.1315] l.23925 - Make dumping/undumping more efficient - eqtb
@@ -3970,7 +3976,7 @@
 primitive("special",extension,special_node);@/
 @y
 primitive("special",extension,special_node);@/
-special_loc:=cur_val; special_token:=cs_token_flag+special_loc;@/
+text(frozen_special):="special"; eqtb[frozen_special]:=eqtb[cur_val];@/
 @z
 
 % [53.1350] (new_write_whatsit) Allow 18 as a \write stream. We never
@@ -4448,7 +4454,7 @@
 , line)) then begin
     toklist := get_avail;
     p := toklist;
-    info(p) := special_token;
+    info(p) := cs_token_flag+frozen_special;
     link(p) := get_avail; p := link(p);
     info(p) := left_brace_token+"{";
     q := str_toks (make_src_special (source_filename_stack[in_open], line));
Index: lib/texmfmp.c
===================================================================
RCS file: /usr/local/cvsroot/texk/texk/web2c/lib/texmfmp.c,v
retrieving revision 1.67
diff -u -r1.67 texmfmp.c
--- lib/texmfmp.c       2 Apr 2002 19:18:10 -0000       1.67
+++ lib/texmfmp.c       1 Jun 2002 09:25:00 -0000
@@ -767,6 +767,7 @@
          insertsrcspecialeverypar = true;
          insertsrcspecialauto = true;
          srcspecialsoption = true;
+         srcspecialsp = true;
        } else {
           parse_src_specials_option(optarg);
        }
@@ -865,6 +866,10 @@
     tok = strtok(0, ", ");
   }
   free(toklist);
+  srcspecialsp=insertsrcspecialauto | insertsrcspecialeverypar |
+    insertsrcspecialeveryparend | insertsrcspecialeverycr |
+    insertsrcspecialeverymath |  insertsrcspecialeveryhbox |
+    insertsrcspecialeveryvbox | insertsrcspecialeverydisplay;
   srcspecialsoption = true;
 }
 #endif




--- omegadir/comsrcspec.ch-     Sun Nov 11 18:07:06 2001
+++ omegadir/comsrcspec.ch      Sat Jun  1 00:56:05 2002
@@ -7,6 +7,7 @@
 
 @!file_line_error_style_p:boolean; {output error messages with a C style. }
 
+@!src_specials_p : boolean;
 @!insert_src_special_auto : boolean;
 @!insert_src_special_every_par : boolean;
 @!insert_src_special_every_parend : boolean;


-- 
Olaf Weber

               (This space left blank for technical reasons.)