[NTG-context] Using \overloaded

Hans Hagen j.hagen at xs4all.nl
Sun Jan 24 12:56:14 CET 2021


On 1/24/2021 5:13 AM, Rik Kabel wrote:
> Hans and all,
> 
> Preparing my standard environments for future strict enforcement of 
> overloading prevention, I have run into one issue.
> 
> I had been using the following construction to change the formatting of 
> URLs:
> 
>     \let\OrigHyphenatedurl\hyphenatedurl
>     \starttexdefinition hyphenatedurl #URL
>        \begingroup
>          \URLfont\OrigHyphenatedurl{#URL}
>        \endgroup
>     \stoptexdefinition
> 
> This results in the following warning about overloading \hyphenatedurl:
> 
>     csname overload > warning, protection level 3, control sequence
>     'hyphenatedurl', properties 'permanent protected', file
>     'env_layout.mkvi', line 1
> 
> I have tried adding \overloaded to indicate the intentional overloading, 
> but \overloaded cannot be used with \starttexdefinition, so I rewrote it as:
> 
>     \let\OrigHyphenatedurl\hyphenatedurl
>     \overloaded\define[1]\hyphenatedurl{%
>        \begingroup%
>          \URLfont\OrigHyphenatedurl{#1}%
>        \endgroup}%
> 
> but that (and also with \overloaded\def\hyphenatedurl#1...) gives the 
> same (except for the line number) warning:
> 
>     csname overload > warning, protection level 3, control sequence
>     'hyphenatedurl', properties 'permanent protected', file
>     'env_layout.mkvi', line 822
> 
> So, what is the proper way to indicate intentional overloading? Or 
> should this redefinition be done in another way?

\pushoverloadmode
    ...
\popoverloadmode

> (Also, it is interesting that the line number in the first warning 
> message does not point to the actual line.)
that has ot do with whne an error is encountered not where it originates 
from

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list