Consider this TeX file (yes, I know it's highly unusual to not use dtx for this.)
%%! TEX program = lualatex
\documentclass{l3doc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\fvset{gobble=0,tabsize=4,frame=single,numbers=left,numbersep=3pt}
\usepackage{hyperref}
\usepackage{csquotes}
%\MakeOuterQuote{"}
\begin{document}
\GetFileInfo{\jobname.tex}
\DoNotIndex{\endlinechar,\newcommand}
\title{\pkg{somenewpackage} --- Description
\thanks{This file describes version \fileversion, last revised \filedate.}
}
\author{user202729%
%\thanks{E-mail: (not set)}
}
\date{Released \filedate}
\maketitle
\section{Motivation}
The braces around \verb+{\data}+ is optional; however, in the unlikely case if \cs{endlinechar} has the \enquote{letter} catcode, it might be absorbed and gives unexpected result.
\cs{mycommand}
\begin{macrocode}
\newcommand{\dummyMacro}{}
% \end{macrocode}
\StopEventually{%
\PrintChanges
\PrintIndex
}
\Finale
\end{document}
Without the \DoNotIndex, the \endlinechar, \mycommand (appear in \cs{...}),
and \newcommand (appear in macrocode block) is included in the index.
With it, the \newcommand disappear but \endlinechar remains.
What is going on? (needless to say I don't see this in l3doc manual) & what should I do?
(actually that \cs{...} should probably be \tn, in retrospect. Either way, the problem persists)
I can see a few options
- use
|\endlinechar|or"\endlinechar"instead of\cs{endlinechar}to typeset it? (... by the way this appear to be another undocumented thing in l3doc that it automatically make|and"shortverb...?) - just deal with it?
- anything else?

ltxdocinstead ofl3docclass is used, neither is included in the index. – user202729 Jul 08 '22 at 05:25