For information, here is what I have done to solve my problem
1/ I have defined a couple of counters
\newcounter{numsection} % count the index of the sections
\newcounter{skipsection} % number of the section to remove at the beginning
\newcounter{lastsection} % index of the last section to display
\def\tmp@skipsection{0} % temporary variable
\def\tmp@lastsection{0} % temporary variable
2/ Definition of the function to set the counters; they have to be called before the \section command
\newcommand{\setskipsection}[1]{\gdef\tmp@skipsection{#1}}
\newcommand{\setlastsection}[1]{\gdef\tmp@lastsection{#1}}
3/ Installation of the hooks using \AtBeginSection command:
\AtBeginSection[]{
\setcounter{skipsection}{\tmp@skipsection}
\setcounter{lastsection}{\tmp@lastsection}
\setskipsection{0}
\setlastsection{0}
\sectionframe
}
4/ Redefinition of the relevant template:
a) reset the counter for the section index
\defbeamertemplate*{sidebar left}{modele-name}
{%
\setcounter{numsection}{0}%
\insertverticalnavigation{\beamer@leftsidebar}%
}
b) code for a normal section, essentially to count the index of the section
\defbeamertemplate*{section in sidebar}{modele-name}
{%
\stepcounter{numsection}%
\ifnum\value{numsection}>\value{skipsection}%
% code for typesetting section name
\fi%
}
c) code for a shaded section
\defbeamertemplate*{section in sidebar shaded}{modele-name}
{%
\stepcounter{numsection}%
\ifnum\value{lastsection}=0%
\ifnum\value{numsection}=\value{skipsection}%
% code to display the *collapsed* sections at the beginning of the sidebar
\fi%
\ifnum\value{numsection}>\value{skipsection}%
% code to display a normal shaded section
\fi%
\else%
\ifnum\value{numsection}=\value{skipsection}%
% code to display the *collapsed* sections at the beginning of the sidebar
\fi%
\ifnum\value{numsection}>\value{skipsection}%
\ifnum\value{numsection}<\value{lastsection}%
% code to display a normal shaded section
\fi%
\ifnum\value{numsection}=\value{lastsection}%
% code to display the *collapsed* sections at the end of the sidebar
\fi%
\fi%
\fi%
}
\partbetween each group of\sections. – Paul Gaborit Dec 04 '12 at 14:27\partwill solve the problem of space, but will also "remove" the display of the entire TOC. Ideally, I would prefer to keep as much as possible the TOC, by "shifting" the content of the sidebar to the bottom or to the top. – Lionel MANSUY Dec 05 '12 at 09:11