State lawmakers yesterday managed to pass an emergency bill to keep government running. Be grateful for small favors, we guess.

After all, it wasn’t clear until early evening that the state Senate could muster enough votes to avert a shutdown.

And long-term prospects remain grim.

For starters, lawmakers appear to be plotting all manner of gimmickry to “close” the state’s $9.2 billion budget gap. The New York Times, for example, suggested Saturday that Albany had “tentatively agreed” to borrow some $2 billion over the next three years from the state-employee pension fund — and to use the money to pay its mandatory contributions to . . . that same pension fund.

Municipalities across the state would be allowed to borrow another $4 billion for the same purpose.

Gov. Paterson denied the report, but he’s been wrong in the past (to put it mildly) — and his own proposed budget contains a similar scheme.

The problem with such flimflammery?

Simple: Making ends meet by charging everyday expenses to a credit card — the essence of such borrowing — is not sustainable; eventually, you go bust.

That was supposed to be the key lesson taken away from New York City’s brush with municipal bankruptcy in the 1970s.

And what amounts to a raid of the pension fund isn’t the only worrisome trick up Albany’s sleeve. Some senators want another advance of funds based on future tobacco-settlement revenues.

Already, legislation has been signed into law that promises $70 million in Medicaid savings this year and $150 million next year — even as a key actuarial firm, Milliman, Inc., says any such savings will be “minimal.”

Illusory would be more like it.

Yes, eventually lawmakers may agree on a budget plan for the current year (they’re already 76 days late).

But if all they’ve done is dig a bigger hole for the future, why bother?