ref, label, newlabel: Usage

<..cross ref..>
 \def\:tempc#1{\a:pageref\o:pageref:{#1}\b:pageref}
 \HLet\pageref\:tempc
 \NewConfigure{pageref}[3]{%
    \def\a:pageref{#1\bgroup \Configure{ref}{\Link}{\EndLink}{#3}}%
    \def\b:pageref{\egroup #2}%
 }
 \Configure{pageref}{}{}{}
 -_-_-

<..cross ref..>+
 \NewConfigure{@newlabel}[1]{\concat:config\a:@newlabel{#1}}
 \let\a:@newlabel=\relax
 <.configure @newlabel.>
 \NewConfigure{newlabel}[2]{%
    \def\a:newlabel{#1}\ifx  \a:newlabel\empty
       \def\label:addr{\cur:th \:currentlabel}%
    \else
       \def\label:addr{#1}%
    \fi
    \def\a:newlabel##1{\expandafter\string\c:rEfLiNK{\label:addr}{#2}}}
 \NewConfigure{ref}[3]{%
    \def\a:rEfLiNK{#1}\def\b:rEfLiNK{#3}%
    \ifx \a:rEfLiNK\empty
       \ifx \b:rEfLiNK\empty
          \expandafter\def\c:rEfLiNK##1##2{##2}%
       \else
          \expandafter\def\c:rEfLiNK##1##2{#3}%
       \fi
    \else
       \ifx \b:rEfLiNK\empty
          \expandafter\def\c:rEfLiNK##1##2{#1{##1}{}##2#2}%
       \else
          \expandafter\def\c:rEfLiNK##1##2{#1{##1}{}#3#2}%
       \fi
    \fi
    \def\b:rEfLiNK{#2}%
 }
 \Configure{newlabel}{\cur:th \:currentlabel}{#1}
 \NewConfigure{newlabel-ref}[1]{\def\c:rEfLiNK{#1}%
    \ifx \at:startdoc\:UnDef \dflt:ref{#1}\else
       \pend:def\at:startdoc{\dflt:ref{#1}}\fi
 }
 \def\dflt:ref#1{\if@filesw\immediate\write\@auxout{\string\ifx
     \string#1\string\UnDef\gdef\string#1\#1\#2{\#2}\string\fi}\fi}
 \Configure{newlabel-ref}{\rEfLiNK}
 \let\:writefile=\@writefile
 \def\@writefile#1{\bgroup \catcode‘\:=11 \:wrtfile{#1}}
 \def\:wrtfile#1#2{\egroup\:writefile{#1}{#2}}
 -_-_-

 
 > One more thing.  You will notice from ‘minitoc.tex’ that the HTML 
 > anchors given to the sections depend on the value of \@currentlabel, 
 > be it set explicitely or implicitly (e.g., by the previous section). 
 > Is it what you want ? 
 
Yes.  I believe the reason was to avoid ambiguities--unfortunately, 
I can’t locate now where they could occur. 
 
 
{\makeatletter \gdef\@currentlabel{XxX}} 
\section*{first section/First chapter} 
\section{second section/First chapter} 
\section*{third section/First chapter}