I examined the bike today. The derailleur was broken into two parts! I think the sequence of events was:
1. I was going over rough ground,
2. I hadn't done up the catch on the pannier that stops it coming off the rack.
3. The pannier came off one of its hooks to the rack.
4. It swung round, and fouled the derailleur mechanism.
5. The derailleur mechanism got into the back wheel.
6. The bike came to an abrupt halt. Fortunately, I didn't fall off.
There's no way the derailleur can be mended. Fortunately, bike parts are astonishingly cheap - a new derailleur mechanism is about £7. I also bought a new chain and master links for it.
Then I remembered. I had a problem once before with the freewheel, and the bike shop replaced the freewheel, and also told me I needed a new chain and derailleur mechanism. I let them do the work, it wasn't too expensive, but I took the old parts away with me. So I had a working derailleur!
I looked in my box of bits, and sure enough, there it was. The jockey wheels were very loose, so the shop was right to do the replacement, but hey, I have a couple of perfectly good jockey wheels on my broken mech. So I put the jockey wheel from the broken mech onto the old mech, and installed it on the bike.
"Installed it on the bike", such a short and simple phrase, but involving a couple of hours work. This is partly because I've never done this job before, and partly because the bike was missing a threaded hole to secure the mech - I had to improvise a bit.
Now the cable - the disaster that hit the mech, also did bad things to the gear changing cable. That was easy to fix; I just cut off the half-inch that was messed up and rethreaded it.
With that done, I had to adjust the derailleur so that I could get each of the seven gears.
And then I retrued the back wheel, because it wasn't exactly true, and was rubbing against the brakes at one point in its revolution.
And then the rear carrier. I had a problem there; it had been fouling the top gear. So I removed it, and put it back further away from the gears. That seemed to work OK.
The valve on the back wheel was at an acute angle to the rim - it had started at a right angle, but the tube must have slithered round. I deflated it, slithered it back and reinflated.
The pannier needs to be protected from anything sharp nearby, otherwise it just rips. So I taped a plastic shield over the rack where it touches the pannier. And then, because one of the batteries that I'm carrying cant fit inside the metal lunchbox inside the pannier,it has to go on the outside, and there's only the canvas pannier between it any anything that might damage it. So I "armour plated" it with a length of corrugated cardboard, so it has at least some protection.
And now the bike is ready for its next adventure.