If the rice needs washing, wash well in several changes of cold water and leave to soak for 1 hour. Then drain in a colander for at least 30 minutes.
Heat ghee or oil in a large, heavy saucepan and fry the sliced onion with the cinnamon, cardamoms, black pepper and cloves until the onions are golden, stirring frequently so that they brown evenly. Add the rice and fry for about 3 minutes, then pour in the stock or water. Add the salt and stir well while bringing quickly to the boil. Turn heat very low, cover tightly and cook without lifting lid for 25 minutes. Uncover, allow steam to escape for a few minutes, remove whole spices.
Serve hot with curry.