I basically have the same question as this one Table of contents: section titles ragged right but none of the two solutions there work with memoir. I want to typeset section etc. titles raggedright instead of justified.
tocstyle just breaks when loaded with memoir and patching \@dottedtocline doesn't do anything. I also tried to change \cftKaftersnumb and \cftKfont, either of which should work according to my understanding of section 9.2 of the memoir documentation but neither definition works.
Here my attempt so far, MWE adapted from lockstep's answer to the linked question.
\documentclass{memoir}
\renewcommand{\cftsectionaftersnumb}{\raggedright}
\renewcommand{\cftsectionfont}{\raggedright}
\renewcommand{\cftchapteraftersnumb}{\raggedright}
\renewcommand{\cftchapterfont}{\raggedright}
\newcommand*{\sometext}{%
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.%
}
\begin{document}
\tableofcontents
\chapter{\sometext}
\section{\sometext}
\end{document}
