summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-lnt.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-12-02 00:11:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-12-02 00:11:00 +0100
commitf8b69b75c7982cc54043d7ebea2bf3ba72962b5d (patch)
tree7891f0d658619a64fd7733820eeff31a52fbf242 /tex/context/base/strc-lnt.mkiv
parent292f13e9393919609bb24db1b73365c1f3e12196 (diff)
downloadcontext-f8b69b75c7982cc54043d7ebea2bf3ba72962b5d.tar.gz
beta 2010.12.02 00:11
Diffstat (limited to 'tex/context/base/strc-lnt.mkiv')
-rw-r--r--tex/context/base/strc-lnt.mkiv28
1 files changed, 13 insertions, 15 deletions
diff --git a/tex/context/base/strc-lnt.mkiv b/tex/context/base/strc-lnt.mkiv
index 1289057df..442a9378f 100644
--- a/tex/context/base/strc-lnt.mkiv
+++ b/tex/context/base/strc-lnt.mkiv
@@ -14,18 +14,16 @@
\writestatus{loading}{ConTeXt Structure Macros / Line Notes}
%D This module loads on top of the footnote and line numbering macros.
-%D
-%D ln: might go away
\unprotect
-\newcounter\linenotecounter \newif\iftracelinenotes % will be tracker
+\newcount\noflinenotes \newif\iftracelinenotes % will be tracker
\def\dohandlelinenote#1#2#3%
{\bgroup
\def\linenotelinenumber##1{\inlinerange[#2]}% ##1 == order
- \setupnote[ln:#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
- \setnote[ln:#1]{#3}%
+ \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
+ \getvalue{\??vn:ln:#1}{#3}%
\egroup}
\def\dotracedlinenote#1%
@@ -34,7 +32,7 @@
{\forgetall
\hsize\zeropoint
\hss
- \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
+ \vbox to \strutheight{\llap{\red\infofont\setstrut\the\noflinenotes}\vss}%
{\color[blue]{\vl}}%
\vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
\hss}%
@@ -42,13 +40,13 @@
\fi}
\def\dolinenote#1#2%
- {\doglobal\increment\linenotecounter
- \dohandlelinenote{#1}{\linenotecounter}{#2}%
+ {\global\advance\noflinenotes\plusone
+ \dohandlelinenote{#1}{\the\noflinenotes}{#2}%
\dotracedlinenote\empty
- \expanded{\someline[\linenotecounter]}}
+ \normalexpanded{\someline[\the\noflinenotes]}}
\def\dostartlinenote#1[#2]#3%
- {\doglobal\increment\linenotecounter
+ {\global\advance\noflinenotes\plusone
\dohandlelinenote{#1}{#2}{#3}%
\dotracedlinenote{#2}%
\startline[#2]}
@@ -57,16 +55,16 @@
{\stopline[#2]}
\unexpanded\def\definelinenote
- {\dodoubleempty\dodefinelinenote}
+ {\dotripleempty\dodefinelinenote}
-\def\dodefinelinenote[#1][#2]%
- {\definenote[ln:#1][#2]%
+\def\dodefinelinenote[#1][#2][#3]%
+ {\dodefinenote[#1][#2][#3]% do as we need to test for arguments
+ \expandafter\let\csname\??vn:ln:#1\expandafter\endcsname\csname#1\endcsname % use copy command
\setuvalue {#1}{\dolinenote {#1}}%
\setuvalue{\e!start#1}{\dostartlinenote{#1}}%
\setuvalue{\e!stop #1}{\dostoplinenote {#1}}}
-\unexpanded\def\setuplinenote[#1]% convenient
- {\setupnote[ln:#1]}
+\let\setuplinenote\setupnote
% We predefine one, namely \type {\linenote} cum suis.