By Sarah Mukherjee
Environment correspondent, BBC News
Campaigners have been calling for a climate bill for a long time
Environmental group Friends of the Earth is having a party, and they may well feel they have cause to celebrate.
Their "Big Ask" campaign, to get the government to commit to a climate change bill, has got exactly what it asked for.
It has been a long process, requiring senior campaigners to cross the country (presumably offsetting their carbon emissions), debating in town and village halls with MPs and persuading them of their case.
More than 400 politicians had signed up to the campaign before the government, in one of the less well kept secrets of the Queens' speech, announced on Wednesday that it would be included as part of Tony Blair's last legislative programme.
In its election manifesto of 1997, the Labour Party promised to "lead the fight against global warming". So why, environmental groups ask, has it taken so long to get this bill into the queue for the statute book?
Well, government spokesmen argue, they have been working hard internationally. Tony Blair made climate change one of his priorities for the UK Presidency of the G8.
And Margaret Beckett, as Environment Secretary, was one of the key behind-the-scenes figures that got agreement on the Kyoto Protocol, and we are now leading the debate on moving the European Emissions Trading Scheme (ETS) forward.
The ETS creates a regulated "market" for carbon. The idea is that, at regular intervals, governments reduce the amount of carbon dioxide (CO2) industry is allowed to pump out.
Companies are given "credits", and those that have a low carbon footprint can sell credits to firms that use more than their allowance, creating a market - and a price - for carbon pollution.
Quiet on home front
But environmental groups point to the government's lack of energy on the domestic front.
Carbon emissions are rising, not falling; although the government points out that, overall, the levels of the six greenhouse gases scientists say are contributing to climate change are on the way down.
Officials have already admitted that they are likely to miss the government's self-imposed target of a 20% reduction in CO2 emissions by the year 2010.
Feeling the heat: campaigners say pressure on Mr Blair paid off
So, it is just green pressure that is pushing the government towards a bill, and what exactly is it going to look like?
Well, the answer to the first question depends on who you talk to.
The Conservatives are in no doubt about who's making the running on this issue - them. Why, they ask, this year of all years - the first of David Cameron's leadership - has the government brought forward a climate bill?
It is surely no coincidence, they say, that it should come within months of Mr Cameron making climate change one of his key priorities, and sharing a platform with green groups on this issue.
But others point to a more general awareness of the issues of global warming over the last few years.
"Business, too, wants a framework on greenhouse gas emissions reductions, and certainty, so they can plan for the medium-term," says Jonathon Porritt, chairman of the government's independent watchdog, the Sustainable Development Commission.
Devil in the detail
But what it is going to look like? Well, at its most timid, it could be, according to the green groups, not worth the paper it is written on.
At its most radical, they say, it could be a genuine step forward towards a low carbon economy. The devil, as with so many of these things, is in the detail.
The bill, as we know it thus far, will give legislative force to the government's target of a 60% in carbon dioxide emissions by 2050.
There is also a commitment to interim targets - to ensure that present governments do not "party while the world burns" and leave the carbon-reducing pain to their political successors.
A lot of heat and light surrounds the question of how frequent those targets should be. Environmental groups, the Conservatives and the Liberal Democrats all support the idea of annual targets.
"There have to be annual so the government's progress can be assessed," according to Lib Dem environment spokesman Chris Huhne.
The Tories' policy chief, Oliver Letwin, agrees: "It's about culture change," he says.
"Of course you won't always hit all the targets. But if you miss them because it's a cold winter, nobody's going to blame you.
"If you keep missing them because your policies are useless, then it will be a severe embarrassment."
A very cold winter could affect annual targets, ministers say
The government argues that one cold winter, or an unexpected change in the price of fossil fuels, would crash through the figures.
Better to have, they say, interim targets, maybe of five years - the life of a Parliament - so you can balance the carbon books more easily.
Privately, in fact, many environmental groups say they could live with five year targets. This period of time between targets would also be more likely to please business, as the CBI say annual targets would be "unworkable".
There will also be a committee to "work with ministers" to achieve climate change. I understand the government is considering a range of options on this one.
It could just be an advisory panel or it could be a watchdog with a bite as effective as its bark, with the power to call the government to account if it is slipping from the greenhouse gas emissions downward trajectory.
Government sources say they will be "consulting widely" on these details, with a bill due in the next few months. This consultation period will be the crucial test for the success of the green groups.
The (environmentally friendly) champagne corks may be popping at the Friends of the Earth party, but they know there is a lot more lobbying ahead before they can really roll out the (locally sourced) barrel.