summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/alephdir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-02-15 22:44:14 +0000
committerKarl Berry <karl@freefriends.org>2023-02-15 22:44:14 +0000
commit51a8699e8d5e6cc340d65f75a729e552d2ae9dbc (patch)
treefe1dd31160012c18f1255806c037fbe2622b8bf8 /Build/source/texk/web2c/alephdir
parent9f78b913e6fbaa3cd7d1876c608c460da5372921 (diff)
late \special for aleph, following other engines
git-svn-id: svn://tug.org/texlive/trunk@65847 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/alephdir')
-rw-r--r--Build/source/texk/web2c/alephdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/alephdir/am/aleph.am5
-rw-r--r--Build/source/texk/web2c/alephdir/latespecial.ch95
3 files changed, 103 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/alephdir/ChangeLog b/Build/source/texk/web2c/alephdir/ChangeLog
index d3fb8222e3f..e7921499efe 100644
--- a/Build/source/texk/web2c/alephdir/ChangeLog
+++ b/Build/source/texk/web2c/alephdir/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-15 Phelype Oleinik <phelype.oleinik@latex-project.org>
+
+ * latespecial.ch: new change file for "\special shipout".
+ * am/aleph.am (aleph_web_srcs): add latespecial.ch.
+
2022-10-22 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
* com16bit.ch: Sync with tex.ch changes:
diff --git a/Build/source/texk/web2c/alephdir/am/aleph.am b/Build/source/texk/web2c/alephdir/am/aleph.am
index 39f1fb7059f..a79c10c3a27 100644
--- a/Build/source/texk/web2c/alephdir/am/aleph.am
+++ b/Build/source/texk/web2c/alephdir/am/aleph.am
@@ -1,7 +1,7 @@
## $Id$
## texk/web2c/alephdir/am/aleph.am: Makefile fragment for Aleph.
##
-## Copyright 2015-2022 Karl Berry <tex-live@tug.org>
+## Copyright 2015-2023 Karl Berry <tex-live@tug.org>
## Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
@@ -69,7 +69,8 @@ aleph_web_srcs = \
alephdir/eonewdir.ch \
alephdir/eover.ch \
alephdir/eopage.ch \
- alephdir/eochar.ch
+ alephdir/eochar.ch \
+ alephdir/latespecial.ch
aleph.web: tie$(EXEEXT) $(aleph_web_srcs)
$(tie_m) $(aleph_web_srcs)
diff --git a/Build/source/texk/web2c/alephdir/latespecial.ch b/Build/source/texk/web2c/alephdir/latespecial.ch
new file mode 100644
index 00000000000..5f31ca1632a
--- /dev/null
+++ b/Build/source/texk/web2c/alephdir/latespecial.ch
@@ -0,0 +1,95 @@
+% latespecial.ch: Adding the "shipout" keyword to \special
+%
+% This file is part of the Omega project, which
+% is based on the web2c distribution of TeX.
+%
+% Copyright (c) 2023 Phelype Oleinik
+%
+% This library is free software; you can redistribute it and/or
+% modify it under the terms of the GNU Library General Public
+% License as published by the Free Software Foundation; either
+% version 2 of the License, or (at your option) any later version.
+%
+% This library is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% Library General Public License for more details.
+%
+% You should have received a copy of the GNU Library General Public
+% License along with this library; if not, write to the Free Software
+% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+@x
+@d language_node=4 {|subtype| in whatsits that change the current language}
+@y
+@d latespecial_node=4 {|subtype| in whatsits for \.{\\special shipout}}
+@d language_node=5 {|subtype| in whatsits that change the current language}
+@z
+
+@x
+@d immediate_code=4 {command modifier for \.{\\immediate}}
+@d set_language_code=5 {command modifier for \.{\\setlanguage}}
+@y
+@d immediate_code=5 {command modifier for \.{\\immediate}}
+@d set_language_code=6 {command modifier for \.{\\setlanguage}}
+@z
+
+@x
+begin new_whatsit(special_node,write_node_size); write_stream(tail):=null;
+p:=scan_toks(false,true); write_tokens(tail):=def_ref;
+end
+@y
+begin if scan_keyword("shipout") then
+begin new_whatsit(latespecial_node,write_node_size); write_stream(tail):=null;
+p:=scan_toks(false,false); write_tokens(tail):=def_ref;
+end else
+begin new_whatsit(special_node,write_node_size); write_stream(tail):=null;
+p:=scan_toks(false,true); write_tokens(tail):=def_ref;
+end; end
+@z
+
+@x
+language_node:begin print_esc("setlanguage");
+@y
+latespecial_node:begin print_esc("special"); print(" shipout");
+ print_mark(write_tokens(p));
+ end;
+language_node:begin print_esc("setlanguage");
+@z
+
+@x
+write_node,special_node: begin r:=get_node(write_node_size);
+@y
+write_node,special_node,latespecial_node: begin r:=get_node(write_node_size);
+@z
+
+@x
+write_node,special_node: begin delete_token_ref(write_tokens(p));
+@y
+write_node,special_node,latespecial_node: begin delete_token_ref(write_tokens(p));
+@z
+
+@x
+begin synch_h; synch_v;@/
+old_setting:=selector; selector:=new_string;
+show_token_list(link(write_tokens(p)),null,pool_size-pool_ptr);
+@y
+@!q,@!r:pointer; {temporary variables for list manipulation}
+@!old_mode:integer; {saved |mode|}
+begin synch_h; synch_v;@/
+old_setting:=selector; selector:=new_string;
+selector:=old_setting;
+if subtype(p)=latespecial_node then
+ begin @<Expand macros in the token list
+ and make |link(def_ref)| point to the result@>;
+ write_tokens(p):=def_ref;
+ end;
+selector:=new_string;
+show_token_list(link(write_tokens(p)),null,pool_size-pool_ptr);
+@z
+
+@x
+special_node:special_out(p);
+@y
+special_node,latespecial_node:special_out(p);
+@z