I'm working in memoir class and creating ToC with both short and (sometimes very) long chapter title. I need to:
- Adjust horizontal spacing between part\chapter number and the title so they won't be overlapped, no matter how long the digits\numbers are. The left part of longer-number title doesn't have to be aligned with the shorter one. I prefer the spacing would be automatic/adjustable (depends on the part or chapter digit/number). Thanks.

- Sometimes there's an unwanted vertical spacing between two chapter title in random.

What is the proper way to fix them? I've tried to search for same problems here, but still no luck. Accident/unwanted vertical spacing is still bothering. Thanks.
\documentclass[12pt,twoside]{memoir}
\usepackage[paperwidth=140mm, paperheight=210mm, margin=20mm]{geometry}
\usepackage{titletoc}
\renewcommand\thepart{\arabic{part}}
% simulate larger part and chapter number
\setcounter{part}{50}
\setcounter{chapter}{1200}
\begin{document}
\tableofcontents
\part{This is My First Part}
\chapter{This is first chapter}
\chapter{This is very very long chapter title}
\chapter{Next chapter goes here}
\part{This is My Second Chapter}
\chapter{Very long chapter title also goes here}
\chapter{Another chapter goes here}
\chapter{Another chapter goes here}
\chapter{Another chapter goes here}
% ...and so on...
\end{document}
UPDATE:
In addition to my Pastebin, here's the replicated main.tex.
Hope this helps. Thank you.
\documentclass[12pt,twoside]{memoir}
\usepackage[paperwidth=140mm, paperheight=210mm, margin=20mm]{geometry}
\usepackage{libertine}
\usepackage{graphicx}
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\usepackage{fourier-orns}
\usepackage{bbding}
\usepackage{pdfpages}
\usepackage{lipsum}
% quote
\newcommand*\openquote{\makebox(25,-22){\scalebox{5}{``}}}
\newcommand*\closequote{\makebox(25,-22){\scalebox{5}{''}}}
\colorlet{shadecolor}{Azure}
\makeatletter
\newif\if@right
\def\shadequote{\@righttrue\shadequote@i}
\def\shadequote@i{\begin{snugshade}\begin{quote}\openquote}
\def\endshadequote{%
\if@right\hfill\fi\closequote\end{quote}\end{snugshade}}
\@namedef{shadequote*}{\@rightfalse\shadequote@i}
\@namedef{endshadequote*}{\endshadequote}
\makeatother
% END quote setting
\usepackage{type1cm}
\usepackage{lettrine}
\usepackage{pdfpages}
\chapterstyle{dash}
\usepackage{textcomp}
\usepackage{gensymb}
\renewcommand{\cftchapterfont}{\normalfont}
% ToC Setting
% http://tex.stackexchange.com/questions/201358/styling-toc-dot-leader-using-emdash-and-other-formatting-requirements
% Redefinitions of \part-entry in ToC
% \renewcommand{\cftpartname}{Part~}
\renewcommand{\cftpartname}{Part~}
\renewcommand{\cftpartaftersnum}{:}
\renewcommand{\cftpartleader}{---}
\renewcommand{\cftpartformatpnum}[1]{%
\cftpartformatpnumhook{#1}%
{\cftpartpagefont #1}}
\renewcommand{\cftpartafterpnum}{\hfill\null}
% Redefinition of \chapter-entry in ToC
% \renewcommand{\cftchaptername}{Chapter~}
% \renewcommand{\cftchapteraftersnum}{:}
\renewcommand{\cftchaptername}{}
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterleader}{---}
\let\oldcftchapterfont\cftchapterfont
\renewcommand{\cftchapterfont}{\oldcftchapterfont\mdseries}
\renewcommand{\cftchapterformatpnum}[1]{%
\cftchapterformatpnumhook{#1}%
{\cftchapterpagefont #1}}
\let\oldcftchapterpagefont\cftchapterpagefont
\renewcommand{\cftchapterpagefont}{\oldcftchapterpagefont\mdseries}
\renewcommand{\cftchapterafterpnum}{\hfill\null}
% Distance between part and chapter
\setlength{\cftbeforepartskip}{1em} % part
\setlength{\cftbeforechapterskip}{3pt} % chapter
% Arabic-style page numbering
% http://tex.stackexchange.com/questions/129592/add-parts-to-the-table-of-contents
\renewcommand\thepart{\arabic{part}}
% change font size of ToC item & number
% \renewcommand{\cftpartfont}{\Large\bfseries}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
% GOOD (by Werner)
% http://tex.stackexchange.com/questions/201940/toc-content-spacing-and-related-formatting?noredirect=1#comment470627_201940
\renewcommand{\partnumberlinebox}[2]{#2 }
\renewcommand{\chapternumberlinebox}[2]{#2 }
% Past:
%\setlength{\cftchapternumwidth}{2em}
%\setlength{\cftpartnumwidth}{2em}
% --- END ToC settings
% RUNNING HEADER
% The following code have been found in Peter Wilsons Memoir manual in chapter 7 (page127)
\makepagestyle{My_pagestyle} % Create a new pagestyle
% Following code to edit the pagestyle
\makepsmarks{My_pagestyle}{\nouppercaseheads
% This is where we specify what \leftmark and \rightmark contains
%\createmark{chapter}{both}{nonumber}{}{\space}
%\createmark{section}{right}{nonumber}{}{\space}
% Change "shownumber" to "nonumber" if you don't want the chapter/section number displayed at the header.
\createmark{title}{left}{nonumber}{}{\space}
\createmark{chapter}{right}{nonumber}{}{\space}
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}}
% Might want to keep those, see the manual for further information.
% The following is where you tweek your header
% http://hstuart.dk/2007/06/12/styling-the-page-footer-and-header/
% For verso pages
\makeevenhead{My_pagestyle}{\normalfont\thepage\hskip.5cm\vrule\hskip.5cm\footnotesize\Booktitle}{}{}
% For recto pages
\makeoddhead{My_pagestyle}{}{}{\footnotesize\rightmark\hskip.5cm\vrule\hskip.5cm\normalfont\thepage}
% Activate your new pagestyle
\pagestyle{My_pagestyle}
% --- END
% The 'Part' page
% http://tex.stackexchange.com/questions/49512/part-style-in-memoir-class/49534#49534
\renewcommand\partname{Part}
\renewcommand*{\partnamefont}{\normalfont\large} % part name
\renewcommand*{\partnumfont}{\normalfont\large} % part number
\renewcommand*{\parttitlefont}{\normalfont\LARGE} % part title
\renewcommand{\midpartskip}{\par\parbox{0.5in}{\hrulefill}\par}
\renewcommand{\beforepartskip}{\vspace*{\fill}}
\renewcommand{\afterpartskip}{\vspace*{\fill}}
% Set book title and the writer's name
% http://tex.stackexchange.com/questions/195863/include-document-title-in-memoir-class-header
% http://latex-community.org/forum/viewtopic.php?f=47&t=15857
\def\Booktitle{My book title goes here}
\title{\Booktitle}
\author{The writer's name}
\date{}
% Let's do it
\begin{document}
\frontmatter
% ENDORSEMENT
\pagestyle{empty}
\include{./include/00-prelims-pages/endorsement}
\cleardoublepage % Start a new odd page (manually)
% BOOK TITLE
\include{./include/00-prelims-pages/booktitle-01}
\cleardoublepage % Start a new odd page (manually)
\include{./include/00-prelims-pages/booktitle-02}
% BOOK INFO, ISBN, ETC
\include{./include/00-prelims-pages/kdt}
% DEDICATION
\include{./include/00-prelims-pages/dedication}
\pagestyle{My_pagestyle}
% FOREWORDS
\include{./include/00-prelims-pages/intro}
\cleardoublepage % Start a new odd page (manually)
% TOC
\tableofcontents
% SET PAGE NUMBERING (1, 2, 3.. for main content)
\mainmatter
% PROLOG
\include{./include/00-prelims-pages/prolog}
% PART 1
\part{This is Part}
\include{./include/part-01/01}
\include{./include/part-01/02}
\include{./include/part-01/03}
\include{./include/part-01/04}
\include{./include/part-01/05}
\include{./include/part-01/06}
% PART 2
\part{Part}
\include{./include/part-02/01}
\include{./include/part-02/02}
\include{./include/part-02/03}
\include{./include/part-02/04}
\include{./include/part-02/05}
\include{./include/part-02/06}
\include{./include/part-02/07}
\include{./include/part-02/08}
\include{./include/part-02/09}
\include{./include/part-02/10}
\include{./include/part-02/11}
% PART 3
\part{Part}
\include{./include/part-03/01}
\include{./include/part-03/02}
\include{./include/part-03/03}
\include{./include/part-03/04}
% ...and so on...
% ABOUT THE WRITER
\cleardoublepage % Start a new odd page (manually)
\pagestyle{plain}
\include{./include/about-writer}
% ...and so on...
\end{document}

memoir, but I wonder about this feature. Do you really need 50 parts, 1500 etc. chapters? – Sep 19 '14 at 03:05\renewcommand{\partnumberlinebox}[2]{#2 } \renewcommand{\chapternumberlinebox}[2]{#2 }to your preamble. It allows for a flexible spacing around the number for both\parts and\chapters. – Werner Sep 19 '14 at 03:45\usepackage{titletoc}. I read somewhere here (I forget the link, sorry). Thanks. – Eko san Sep 19 '14 at 17:34