# Is it possible to change the output for each \excludecomment or \includecomment (comments package)?

I am trying to avoid modularizing a document into separate files (because it gets translated into 10 languages!) Instead, I am trying my luck with the comments package.

Let's say I have three software manuals for three variants of the program:

1. appname-demo.tex
2. appname-pro.tex
3. appname.tex

# Problem

The problem seems to me that overlapping includes and excludes would both write to comment.cut. This would cause the file to possibly be empty during an embedded (sequential) read.

From the comment.sty source code:

The comment environments use two auxiliary commands. You can get nifty special effects by redefining them. [...] \def\CommentCutFile{comment.cut}

# Attempt

Does not typeset.

\documentclass{article}
\usepackage{comment}
\usepackage{xstring}
\usepackage{lipsum}

\IfSubStr{\jobname}{\detokenize{pro}}
{\includecomment{include-pro}} % TRUE, so show pro stuff
{\excludecomment{include-pro}}
\IfSubStr{\jobname}{\detokenize{demo}}
{\excludecomment{exclude-demo}} % TRUE, so hide stuff
{\includecomment{exclude-demo}}

%\specialcomment{include-pro-functionality}% Attempt at changing \CommentCutFile
%  {\begingroup\def\CommentCutFile{include-pro.cut}}{\endgroup}
%\specialcomment{hide-in-demo}% Attempt at changing \CommentCutFile
%  {\begingroup\def\CommentCutFile{exclude-demo.cut}}{\endgroup}

\begin{document}
\section{Normal Functions}
\lipsum[1]

\begin{exclude-demo}
\section{Paid-Version Only Functions}
\lipsum[2]
\end{exclude-demo}

\begin{include-pro}
\section{Professional Functions}
\lipsum[3]
\end{include-pro}

\begin{exclude-demo}
\section{Paid-Version Only Functions}
\lipsum[2]
\begin{include-pro}
\subsection{Pro-Version Only Embedded}
\end{include-pro}
\end{exclude-demo}

\end{document}