In a glass bowl, combine half of the flour with the yeast and sugar, set aside.
Heat together the butter, molasses, milk, onion, salt and spices in a saucepan until just warm and the butter has melted.
Cool to room temperature before next step.
Add liquid mixture to flour and yeast, add the egg and beat for 30 seconds at low speed, scraping sides of bowl constantly.
Beat for three minutes at high speed and then add remaining flour, mixing with a wooden spoon until smooth.
Turn out onto a lightly floured board and knead well until enough flour is absorbed to make a well-tempered dough.
Cover and allow to rise until doubled (at least 45 minutes).
Punch the dough down and form desired shape.
Cover and allow to rise an additional 40 minutes or so.
Bake in 350°F or 180°C oven for 35 minutes until done.
Heat liquid ingredients as directed above and cool.
Add to machine container and then add the egg.
Follow with dry ingredients, finishing with the yeast.
Select white loaf, large, dough and add walnuts, if desired when prompted, half way through kneading.
Remove from pan after cycle and shape into loaf, allow to rise 40 minutes or so and then bake as directed above.