Old question, but:
You can make it so that all the common ways of moving around do an auto-indent, like this:
(advice-add 'previous-line :after #'indent-according-to-mode)
(advice-add 'next-line :after #'indent-according-to-mode)
(advice-add 'scroll-up-command :after #'indent-according-to-mode)
(advice-add 'scroll-down-command :after #'indent-according-to-mode)
(add-hook 'isearch-mode-end-hook #'indent-according-to-mode)
This has side effects; as you move around, (a) indentation on non-blank lines will be fixed up, and (b) if you move to a non-blank line within the indentation, the cursor will be automatically pushed to the beginning of the text as with
back-to-indentation. Maybe these are good side effects. However, there is a shortcoming that you can arrive on lines in other ways, like for example if the blank line happens to be at the end of the buffer and you do Alt->, or when you pop the mark ring. But the above might cover enough of the movement scenarios to meet the requirement. I couldn't find a hook that is called after cursor movement of any kind, so if you wanted to be more thorough you might have to use
post-command-hook which starts to seem like a pretty invasive change.
A bigger issue is that this approach leaves trailing whitespace everywhere in your document. (To see it, do Ctrl-Alt-s
[[:space:]]+$ or turn on
global-whitespace-mode). So you could also patch the navigation commands to remove the trailing whitespace before moving away, but even if you do there are ways in which the cleanup will fail to be invoked, like if you save while positioned on an indented blank line. Probably a better approach is not to bother with incremental clean-up, and just sweep the whole document on save, with something like
(add-hook 'before-save-hook 'delete-trailing-whitespace) in your config [ref].)
In all, this is probably not a good thing to do to Emacs because it coarsens your control over the content of the document.