Mike Small and his wife, Karen, sat down last Thursday to a dinner of smoked fish pie crusted with mashed potato and served with purple-sprouting broccoli, an unremarkable family meal except for one key factor: every ingredient came from sources close to their home in Burntisland, Fife. 'The fish was Fife-landed, while the potatoes and broccoli were grown on nearby farms,' he says.

Nor was this a one-off culinary event. For the past six months Mike and Karen and their two children, Sorley and Alex, have consumed only food and drink bought in their home district.

This is the Fife Diet, developed by Mike Small as a response to the environmental dangers posed by carbon-emitting imports of Peruvian avocados, Kenyan green beans, New Zealand lamb and all those other foreign foodstuffs that now fill the shelves of our supermarkets. Each of these imported products involves the emission of carbon dioxide from the planes and ships that brought them to our shores.

So Mike Small argues that we should eat local produce and save the planet, an idea that has obliged his family - and a growing number of adherents to his cause - to eat meals of local lamb, pork and a great many dishes based on parsnips, beetroots, kale, potatoes, leeks and all the other root vegetables that typify the agricultural output of this wind-swept corner of Scotland.

This is the future of ethical eating, insists Small: the consumption of local produce at all costs. It is an attitude now shared by thousands around the UK and overseas, individuals who have decided to reject foods that have been transported over long distances by road, air or sea to their dinner plates. They even have their own name for themselves - locavores - and insist that their way is the only one to save the planet.

But the idea that 'only local is good' has come under attack. For a start, food grown in areas where there is high use of fertilisers and tractors is likely to be anything but carbon-friendly, it is pointed out. At the same time the argument against food miles - which show how far a product has been shipped and therefore how much carbon has been emitted in its transport - has been savaged by experts. 'The concept of food miles is unhelpful and stupid. It doesn't inform about anything except the distance travelled,' Dr Adrian Williams, of the National Resources Management Centre at Cranfield University, told The Observer last week.

Given that the food miles cause was hailed only a few months ago as the means to empower the carbon-conscious consumer, such criticisms are striking, and suggest that some careful reassessment of the concept's usefulness has been going on.

Certainly the issues involved no longer seem clear-cut. Consider that supermarket stalwart: green beans from Kenya. These are air-freighted to stores to allow consumers to buy fresh beans when British varieties are out of season. Each packet has a little sticker with the image of a plane on it to indicate that carbon dioxide from aviation fuel was emitted in bringing them to this country. And that, surely, is bad, campaigners argue. Rising levels of carbon dioxide are trapping more and more sunlight and inexorably heating the planet, after all.

But a warning that beans have been air-freighted does not mean we should automatically switch to British varieties if we want to help the climate. Beans in Kenya are produced in a highly environmentally-friendly manner. 'Beans there are grown using manual labour - nothing is mechanised,' says Professor Gareth Edwards-Jones of Bangor University, an expert on African agriculture. 'They don't use tractors, they use cow muck as fertiliser; and they have low-tech irrigation systems in Kenya. They also provide employment to many people in the developing world. So you have to weigh that against the air miles used to get them to the supermarket.'

When you do that - and incorporate these different factors - you make the counter-intuitive discovery that air-transported green beans from Kenya could actually account for the emission of less carbon dioxide than British beans. The latter are grown in fields on which oil-based fertilisers have been sprayed and which are ploughed by tractors that burn diesel. In the words of Gareth Thomas, Minister for Trade and Development, speaking at a recent Department for International Development air-freight seminar: 'Driving 6.5 miles to buy your shopping emits more carbon than flying a pack of Kenyan green beans to the UK.'

'Half the people who boycott air-freighted beans think they are doing some good for the environment. Then they go on a budget airline holiday to Prague the next weekend,' adds Bill Vorley, head of sustainable markets for the International Institute for Environment and Development. 'They are just making gestures.'

It is not that the concept of food miles is wrong; it is just too simplistic, say experts. In fact, balancing your diet with its carbon costs turns out to be a fiendishly tricky business. Consider these two staples: apples and lettuce. The former are harvested in September and October. Some are sold fresh; the rest are chill stored. For most of the following year, they still represent good value - in terms of carbon emissions - for British shoppers. But by August those Coxs and Braeburns will have been in store for 10 months. The amount of energy used to keep them fresh for that length of time will then overtake the carbon cost of shipping them from New Zealand. It is therefore better for the environment if UK shoppers buy apples from New Zealand in July and August rather than those of British origin.

Then there is the example of lettuces. In Britain these are grown in winter, in greenhouses or polytunnels which require heating. At those times it is better - in terms of carbon emissions - to buy field-grown lettuce from Spain. But in summer, when no heating is required, British is best. Picking the right sources for your apples and lettuces depends on the time of year.

'Working out carbon footprints is horribly complicated,' says Edwards-Jones. 'It is not just where something is grown and how far it has to travel, but also how it is grown, how it is stored, how it is prepared.'

This uncertainty even extends to the Soil Association, which announced last year that it was considering halting its endorsement of air-freighted organic food because their emissions negated the benefits of growing it organically. But now the organisation has dropped the plan and is to continue to endorse air-freighted organic food, provided it is grown under conditions that meet its ethical trade standards.

In addition, the government has revealed that it is changing its stance on food miles, as was recently stressed by Gareth Thomas. 'Food miles alone are not the best way to judge whether the food we eat is sustainable. We need a better-informed food miles debate. Long term, the only fair option is to ensure the prices of the goods we consume, including organic produce, cover the environmental costs wherever the goods are from. We also need a labelling system that tells consumers about how the product is reducing poverty.'

Nor is this argument lost on the nation's supermarkets. 'An airplane sticker is of no environmental value whatsoever, as studies have shown air-freighted products are not necessarily less sustainable than local produce grown in heated greenhouses,' said a spokesman for Tesco. 'Thus we may remove those plane labels in future. What people are actually interested in is the amount of carbon that is emitted during a product's manufacture and import.' As a result, Tesco has promised to put carbon labels on 30 of its own-brand products in the near future: six types of potatoes, 11 types of tomatoes, five types of washing power and liquid capsules, four types of orange juice and six types of light bulbs. 'We want to see how customers react and find out how it affects their purchasing behaviour,' added the spokesman.

In fact, these carbon cost labels have already been tested on a small range of products, including Walkers crisps and Cadburys chocolates. Packets and wrappers have a small C with a downward arrow through it, beside a figure which represents the number of grams of carbon dioxide emitted during the manufacture of that product. In this way it is revealed that packets of Walker's Ready Salted and Salt and Vinegar crisps each generate 75g of carbon, while the cheese and onion variety produced only 74g.

Now this limited range of products is to be expanded and will appear in Tesco and other stores, says the Carbon Trust which - with the British Standards Institute - has been involved in calculating how a meaningful carbon inventory can be compiled for foodstuffs.

Not surprisingly, such exercises have proved to be extraordinarily tricky, says Graham Sinden of the Carbon Trust. 'You have to take into account emissions that occurred in the farmyard, for example. Cows and sheep produce methane, which is far more damaging a greenhouse gas than carbon dioxide. Similarly, fertilisers produce nitrogen oxides that are also dangerous. Then you have the issue of transport and processing. Taking a sheep to the slaughterhouse produces carbon emissions, for instance. Cooking is another factor. That requires heat that in turn releases carbon dioxide. After that you need to store products. That often requires refrigeration, which requires electricity, which releases carbon dioxide. Estimating how long a product will be kept in a store and how efficient is its refrigeration is not easy to assess, but it has to be done.

'Then you have to work out how long your product will be kept at home once it has been purchased. You also have to estimate how efficiently it will be cooked. And finally you have to work out how much carbon is involved in its packaging and how much will be emitted in disposing of those wrappers and labels once discarded.'

For some products, such as crisps, a carbon number is easy to calculate. But for others, the process will be much more awkward. How can you accurately calculate a pizza's carbon footprint when it often comes with a variety of toppings?

Even if you could get a carbon label that accurately reflects a product's impact on the environment and identify products that have high footprints, would you be right in boycotting them? In many cases, such as brands of coffee, these products come from struggling third world nations. Using our Western concerns with the climate as an excuse to increase poverty there has dubious ethical consequences.

In short, the issue of trying to reduce the emissions produced by food is bedevilled by complexity. Even replacing food miles with a carbon footprint figure will only partly simplify the issues, a point stressed by Tara Garnett of the Food Climate Research Network.

'There is only one way of being sure that you cut down on your carbon emissions when buying food: stop eating meat, milk, butter and cheese,' said Garnett. 'These come from ruminants - sheep and cattle - that produce a great deal of harmful methane. In other words, it is not the source of the food that matters but the kind of food you eat. Whether people are prepared to cut these from their shopping lists is a different issue, however.'

The chickpea: A green dilemma

Chickpeas are sold in supermarkets in two versions: dried or cooked. The carbon footprint of the latter is far higher than the former. The only processing involved in drying chickpeas is to lay them out in the sun to drive off moisture. By contrast, heat is needed to cook chickpeas before they are tinned. Hence the carbon gram total for tins of cooked chickpeas would be far greater than those on packets of the dried variety.

'That seems straightforward,' says Graham Sinden, of the Carbon Trust. 'But you can't eat dried chickpeas. You have to cook them. And when you take them home you find the carbon you emitted when cooking those chickpeas exceeds the figure for the tinned variety - because cooking small portions at home is inefficient compared with that of large industrial kitchens.'

As a result, when the trust system is taken up and used widely, the gram measure on a packet of dried chickpeas will include an estimate of the heat that will be used in a customer's home to cook them. But that figure will be a guess, for it will depend on whether the customer uses gas or electricity for cooking. The former is more efficient and less prone to carbon emissions.

As for individuals who use renewable energy to heat their homes and kitchens, they would completely negate the point of carbon labels in many cases. 'That is why it is impossible to have accurate carbon labels on a lot of products,' says Gareth Edwards-Jones, of Bangor University.