Lift the bread pan out of the machine and fit the blade. Put the ingredients, except the olive oil, onion and sugar, in the pan, following the order specified in the manual.
Fit the pan into the machine and close the lid. Set to a 750 g (1½ lb) loaf size on the basic white programme with a pale crust setting. (If your machine does not have a setting for crust colour, set the machine to sweet bread to prevent the cheese over-darkening the crust).
Heat the oil in a frying pan while the programme is running. Add the onion and fry over a medium heat for 5 minutes until softened. Sprinkle with 1 teaspoon of the sugar and fry for 5 more minutes until the onion is lightly caramelized. Leave to cool.
Add the onions gradually when the machine beeps.
At the end of the programme lift the pan out of the machine and shake the bread on to a wire rack to cool.