The order in which the mode line strings appears to correspond to their locations in minor-mode-alist
(?).
Yes, and in a very direct sense -- minor-mode-alist
is literally the mode line component responsible for rendering those values.
Is there a way to control the ordering which doesn't require sorting the values of this list?
On account of the above, no -- not unless you generate some alternative way of rendering that part of the mode line.
You could use after-load-functions
to re-order minor-mode-alist
every time any library is loaded (which should do the trick).
Alternatively...
For example making sure the projectile
mode line string always appears as the second string.
...use delight.el to hide projectile
entirely, but firstly copy that value into a separate mode line construct which you put directly in front of minor-mode-alist
(i.e. between the major mode and the minor modes).
That's not entirely trivial, as all of those things are encapsulated in the value of mode-line-modes
, but see https://emacs.stackexchange.com/a/3927/454 for an example of manipulating that.
I would recommend the re-ordering approach as the simpler option, though.