emacs: refactor smart mode line path substitution