In addition to the aforementioned, there is the "move and patrol" command (also explained in the manual somewhere
) to tell units which are currently moving into a province with a fortress to defend that province immediately instead of retreating into the castle walls in the case of an attack.