emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex 3cf393d43d 6/8: Make preview.sty deal with newer


From: Tassilo Horn
Subject: [elpa] externals/auctex 3cf393d43d 6/8: Make preview.sty deal with newer LaTeX hiding \shipout
Date: Tue, 28 Dec 2021 04:06:02 -0500 (EST)

branch: externals/auctex
commit 3cf393d43da5778c7a22309e1b10a779d15d3bc8
Author: David Kastrup <dak@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Make preview.sty deal with newer LaTeX hiding \shipout
---
 latex/preview.dtx | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/latex/preview.dtx b/latex/preview.dtx
index ff686cef7c..4ecaaab2f4 100644
--- a/latex/preview.dtx
+++ b/latex/preview.dtx
@@ -20,7 +20,7 @@
 %     Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 %     Boston, MA 02110-1301  USA
 % \fi
-% \CheckSum{1760}
+% \CheckSum{1794}
 % \GetFileInfo{preview.sty}
 % \date{\filedate}
 % \author{David Kastrup\thanks{\texttt{bug-auctex@gnu.org}}}
@@ -781,14 +781,41 @@
 % pretty much the same as in |everyshi.sty|.  One of its implications
 % is that if someone does a \cmd{\shipout} of a \emph{void} box,
 % things will go horribly wrong.
-% \begin{macro}{\shipout}
+% \begin{macro}{\pr@@shipout}
 %    \begin{macrocode}
-\let\pr@shipout=\shipout
-\def\shipout{\deadcycles\z@\bgroup\setbox\z@\box\voidb@x
+\def\pr@@shipout{\deadcycles\z@\bgroup\setbox\z@\box\voidb@x
   \afterassignment\pr@shipoutegroup\setbox\z@}
 \def\pr@shipoutegroup{\ifvoid\z@ \expandafter\aftergroup\fi \egroup}
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\pr@shipout}
+%   We now need to check which command we are replacing.  Before
+%   things got sophisticated in 2020 or 2021, this had been
+%   \cmd{\shipout} but now it could be \cmd{\tex\_shipout:D}.  \LaTeX\
+%   got a hook mechanism for managing output routines, but it doesn't
+%   really work well for wholesale replacement of the \cmd{\shipout}
+%   command like |preview| does.
+%    \begin{macrocode}
+\ifx\shipout\@undefined
+  \begingroup
+  \catcode`\:=10
+  \catcode`\_=10
+  \ifx\tex_shipout:D\@undefined
+    \PackageError{preview}{Cannot find \protect\shipout\space primitive}%
+    {preview needs to replace the \protect\shipout\space primitive with
+      its own routine to do its work.  Due to packages or formats
+      interfering, it cannot be identified.  Please report this.}
+  \else
+    \global\let\pr@shipout=\tex_shipout:D
+    \global\let\tex_shipout:D=\pr@@shipout
+  \fi
+  \endgroup
+\else
+  \let\pr@shipout=\shipout
+  \let\shipout=\pr@@shipout
+\fi
+%    \end{macrocode}
+% \end{macro}
 % \subsection{Parsing commands}
 % \begin{macro}{\pr@parseit}
 % \begin{macro}{\pr@endparse}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]