[NTG-context] Using \overloaded

Rik Kabel ConTeXt at rik.users.panix.com
Sun Jan 24 05:13:03 CET 2021


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?

(Also, it is interesting that the line number in the first warning 
message does not point to the actual line.)

-- 
Rik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210123/3f89f0bf/attachment-0001.htm>


More information about the ntg-context mailing list