add tag
निरंजन
If I understand it correctly, whenever one needs to use a register (e.g., `tl`, `str`) internally for their package; they are supposed to use `\⟨scope⟩__⟨module⟩_⟨name⟩_⟨register⟩` kind of syntax. Notice the double underscore in the name. It works okay, but when creating the documentation of the code, I get the following warning:

```
Package l3doc Warning: A control sequence of the form '...__' was used. It
(l3doc)                should only be used in the module '', not in 'xyz'.
```

What does this warning mean? How else shall I use internal registers?
Top Answer
F. Pantigny
A register with a name of the form `\<scope>__<module>_<name>_<type>` is a macro private of the module `<module>`. It should be defined and used only in the module whose name is `<module>`.

On the other side, a register with a name of the form `\<scope>_<module>_<name>_<type>` is public and may be used freely in other modules (but it's not meant to be used by the final LaTeX user).

Your L3 module should begin with an instruction of the form:

```
\ProvidesExplPackage
  { <module> }
  { <date_version> }
  { <version> }
  { <short description> }
```

(After that instruction, the `expl3` syntax is in force).

The names of the form `\<scope>__<module>_<name>_<type>` are allowed only in such a module.



Answer #2
निरंजन
The `l3doc` class offers a shorthand for writing module names. It simply is to write `@@` in command names or variable names. So a variable like `\l__mymodule_thingy_tl` from module `mymodule` can be written as `\l_@@_thingy_tl`. For this conversion to happen, one needs to use `<@@=mymodule>` in the dtx.

This method has a drawback, though. Consider the following MWE:

```
%    \begin{macrocode}
%<*pkg>
%<@@=pkg>
\ExplSyntaxOn
\cs_set:Nn \@@_foo: { foo }
\cs_set:cn { @@ _ bar: } { bar }
\ExplSyntaxOff
%</pkg>
%    \end{macrocode}
```

When compiled with the following ins file:

```
\input l3docstrip.tex
\generate{\file{test.sty}{\from{test.tex}{pkg}}}
```

generates:

```
\ExplSyntaxOn
\cs_set:Nn \__pkg_foo: { foo }
\cs_set:cn { __pkg _ bar: } { bar }
\ExplSyntaxOff
\endinput
```

If you were expecting `__ pkg _ bar:`, you won't get it. So, if you are particular about the formatting of your generated files, you may not want to use this. In that case, simply silence the warning with the following:

```
\msg_redirect_name:nnn { l3doc }
                       { foreign-internal }
                       { none }
```

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.