summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-lnt.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-11-07 17:59:00 +0100
committerHans Hagen <pragma@wxs.nl>2009-11-07 17:59:00 +0100
commit128e5756b60274b62fa31304324abd31c48d711a (patch)
tree017c6ef0e011a1d0be8091942af0044ed9779c13 /tex/context/base/strc-lnt.mkiv
parentf903426253431aaaf98c55ba9567d67a0193df65 (diff)
downloadcontext-128e5756b60274b62fa31304324abd31c48d711a.tar.gz
beta 2009.11.07 17:59
Diffstat (limited to 'tex/context/base/strc-lnt.mkiv')
-rw-r--r--tex/context/base/strc-lnt.mkiv52
1 files changed, 16 insertions, 36 deletions
diff --git a/tex/context/base/strc-lnt.mkiv b/tex/context/base/strc-lnt.mkiv
index d0816cfc7..d80d38900 100644
--- a/tex/context/base/strc-lnt.mkiv
+++ b/tex/context/base/strc-lnt.mkiv
@@ -17,26 +17,13 @@
\unprotect
-\newcounter\linenotecounter
-\newtoks \collectedlinenotes
-\newif \iftracelinenotes
-
-\appendtoks
- \the\collectedlinenotes
-\to \everylinenumber
-
-\appendtoks
- \global\collectedlinenotes\emptytoks
-\to \beforeeverylinenumbering
+\newcounter\linenotecounter \newif\iftracelinenotes % will be tracker
\def\dohandlelinenote#1#2#3%
{\bgroup
- \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
- \ifnum\linenotelinenumber=\linenumber\relax
- \def\linenotelinenumber##1{#2}%
- \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]%
- \setnote[#1]{#3}%
- \fi
+ \def\linenotelinenumber##1{\inlinerange[#2]}% ##1 == order
+ \setupnote[ln:#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
+ \setnote[ln:#1]{#3}%
\egroup}
\def\dotracedlinenote#1%
@@ -54,37 +41,30 @@
\def\dolinenote#1#2%
{\doglobal\increment\linenotecounter
- \doifreferencefoundelse{\??rr:\linenotecounter}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#2}\to\collectedlinenotes}
- \donothing
+ \dohandlelinenote{#1}{\linenotecounter}{#2}%
\dotracedlinenote\empty
- \expanded{\someline[\??rr:\linenotecounter]}}
+ \expanded{\someline[\linenotecounter]}}
\def\dostartlinenote#1[#2]#3%
- {\doifreferencefoundelse{\??rr:#2}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#3}\to\collectedlinenotes}%
- {\unknownreference{#2}}%
+ {\doglobal\increment\linenotecounter
+ \dohandlelinenote{#1}{#2}{#3}%
\dotracedlinenote{#2}%
- \startline[\??rr:#2]}
+ \startline[#2]}
\def\dostoplinenote#1[#2]%
- {\stopline[\??rr:#2]}
-
-% defining them
+ {\stopline[#2]}
\def\definelinenote
{\dodoubleempty\dodefinelinenote}
\def\dodefinelinenote[#1][#2]%
- {\definenote[#1][#2]%
- \setvalue {#1}{\dolinenote {#1}}%
- \setvalue{\e!start#1}{\dostartlinenote{#1}}%
- \setvalue{\e!stop #1}{\dostoplinenote {#1}}}
+ {\definenote[ln:#1][#2]%
+ \unexpanded\setvalue {#1}{\dolinenote {#1}}%
+ \unexpanded\setvalue{\e!start#1}{\dostartlinenote{#1}}%
+ \unexpanded\setvalue{\e!stop #1}{\dostoplinenote {#1}}}
-\def\setuplinenote % convenient
- {\setupnote}
+\def\setuplinenote[#1]% convenient
+ {\setupnote[ln:#1]}
% We predefine one, namely \type {\linenote} cum suis.