I'm using a little macro found on Stack Exchange to define a vertically centered dotfill, but I don't understand it at all and it feels like an "hack" to me. Is there other ways in writing this macro without the \makeatletter and \makeatother, and without the @, using {} for example? Is there other ways in achieving a similar result (i.e to get mid-line centered \dotfill)? Here's a MWE showing the effect:
\RequirePackage[l2tabu,orthodox]{nag}
\documentclass[11pt,twoside,draft]{book}
\usepackage[T1]{fontenc}
\usepackage[nomath]{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{microtype,textcomp}
\usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry}
\makeatletter
\newcommand{\cdotfill}{\leavevmode\cleaders\hb@xt@.44em{\hss$\cdot$\hss}\hfill\kern\z@}
\makeatother
\begin{document}
\mainmatter
\pagestyle{plain}
\chapter{A first chapter}
\section{A section title}
Blablabla blabla bla.
\dotfill
Blablabla blabla bla.
\cdotfill
Blablabla blabla bla.
\end{document}
Preview:

@replace\hb@xt@by\hbox towhich is three tokens rather than one, so saves a couple of bytes but the chance you need those bytes saved in 2003 is small. and similarly replace\z@by0pt– David Carlisle Jul 10 '23 at 13:51@they read as "make @ letter" and "make @ other" so if you are not using@you don't need them – David Carlisle Jul 10 '23 at 14:05@) in the preamble for short fragments so they are almost always used around definitions such as this if they are used at all. – David Carlisle Jul 10 '23 at 14:07\dotfillto see what changed, the original version which just changes.to$\cdot$and keeps the rest the same makes it easier to highlight the change. – David Carlisle Jul 10 '23 at 14:11yyyyyto the text: your macro does not adjust to the surrounding text it just makes a row of cdot which are on the math axis rather than the base line, exactly as if you had a row of+++++which are also centred on the math axis – David Carlisle Jul 10 '23 at 14:18