summaryrefslogtreecommitdiff
path: root/tex/context/base/spac-grd.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/spac-grd.mkiv')
-rw-r--r--tex/context/base/spac-grd.mkiv61
1 files changed, 33 insertions, 28 deletions
diff --git a/tex/context/base/spac-grd.mkiv b/tex/context/base/spac-grd.mkiv
index 487521f6c..7b3ee6d6c 100644
--- a/tex/context/base/spac-grd.mkiv
+++ b/tex/context/base/spac-grd.mkiv
@@ -11,41 +11,42 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D This module will be merged intio spac-ver.mkiv.
+%D This module will be merged into spac-ver.mkiv.
\writestatus{loading}{ConTeXt Spacing Macros / Grid Snapping}
-% buff-ver.mkiv: halfline spacing
-% strc-mat.mkiv: configure math grid (new code needed)
-% page-one.mkiv: to be checked
-% page-mul.mkiv: to be checked and redone
-% page-sid.mkiv: to be checked
-% page-set.mkiv: to be checked
-% strc-not.mkiv: to be checked
-% strc-ren.mkiv: to be checked
-% strc-flt.mkiv: to be checked (captions, probably top/bottom)
-% core-mis.mkiv: to be checked (placement, probbaly harmless)
-
\unprotect
-%D Helpers:
+%D A rather crappy macro that we need to avoid and as such it will probably
+%D disappear:
+
+\installcorenamespace{lastnodepusher}
\let\poplastnode\relax
-\def\pushlastnode
- {\ifdim\lastskip=\zeropoint
- \ifnum\lastpenalty=\zerocount
- \ifnum\lastkern=\zerocount
- \let\poplastnode\relax
- \else
- \edef\poplastnode{\kern\the\lastkern\relax}\kern-\lastkern % untested
- \fi
+\unexpanded\def\pushlastnode
+ {\csname\??lastnodepusher
+ \ifcsname\??lastnodepusher\the\lastnodetype\endcsname
+ \the\lastnodetype
\else
- \edef\poplastnode{\penalty\the\lastpenalty\relax}\nobreak % untested
+ \s!unknown
\fi
- \else
- \edef\poplastnode{\vskip\the\lastskip\relax}\vskip-\lastskip % \removelastskip
- \fi}
+ \endcsname}
+
+\setvalue{\??lastnodepusher\number\kernnodecode}%
+ {\unexpanded\edef\poplastnode{\kern\the\lastkern\relax}%
+ \kern-\lastkern}
+
+\setvalue{\??lastnodepusher\number\gluenodecode}%
+ {\unexpanded\edef\poplastnode{\vskip\the\lastskip\relax}%
+ \vskip-\lastskip}
+
+\setvalue{\??lastnodepusher\number\penaltynodecode}%
+ {\unexpanded\edef\poplastnode{\penalty\the\lastpenalty\relax}%
+ \nobreak}
+
+\setvalue{\??lastnodepusher\s!unknown}%
+ {\let\poplastnode\relax}
%D Moved from supp-box:
@@ -133,13 +134,17 @@
% \startlinecorrection \framed{xxx} \stoplinecorrection
% \input ward \par
+% to be redone:
+
\unexpanded\def\dotopbaselinecorrection{\expandafter\blank\expandafter[\the\d_spac_lines_correction_before]}
\unexpanded\def\dobotbaselinecorrection{\expandafter\blank\expandafter[\the\d_spac_lines_correction_after ]}
\def\showbaselinecorrection
{\def\dobaselinecorrection % visualization is not watertight!
{\bgroup
-\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi
+ \ifdim\prevdepth>\zeropoint
+ \kern-\prevdepth
+ \fi
\setbox\scratchbox\emptyhbox
\wd\scratchbox\hsize
\dp\scratchbox\strutdp
@@ -149,9 +154,9 @@
\egroup
\prevdepth\strutdp}%
\def\dotopbaselinecorrection
- {\hrule\!!height\d_spac_lines_correction_before}%
+ {\hrule\s!height\d_spac_lines_correction_before}%
\def\dobotbaselinecorrection
- {\hrule\!!height\d_spac_lines_correction_after}}
+ {\hrule\s!height\d_spac_lines_correction_after}}
\def\dobaselinecorrection % beware, this one is redefined / used locally elsewhere
{\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi